Skip to main content

Toolset for Plone mono repo maintainers.

Project description

RepoPlone

PyPI PyPI - Python Version PyPI - Wheel PyPI - License PyPI - Status

Code Quality

GitHub contributors GitHub Repo stars

Overview

The RepoPlone is a tool designed to manage mono repos containing a repository.toml configuration file at the repository root.

It provides various commands to streamline repository management, versioning, and release processes.

Setup

Installation

To install the latest version of this tool, run (on an isolated virtual environment):

pip install repoplone

Also, you can use uvx to run this tool, without the need to install it in your environment.

Authentications

PyPi

We use hatch to make the release, please make sure authentication is in place by running:

hatch publish --initialize-auth

GitHub

To add releases to GitHub, you should have an environment variable GH_TOKEN set -- with a valid token -- before running this tool.

export GH_TOKEN='<token>'

NPM

npm whoami

Usage

Prepare the repository

Ensure that your monorepo contains a repository.toml file. Below is an example of such a configuration:

[repository]
name = "fake-distribution"
managed_by_uv = true
changelog = "CHANGELOG.md"
version = "version.txt"
compose = "docker-compose.yml"

[repository.towncrier]
section = "Project"
settings = "towncrier.toml"

[backend]
path = "backend"

[backend.package]
name = "fake.distribution"
path = "backend"
changelog = "backend/CHANGELOG.md"
towncrier_settings = "backend/pyproject.toml"
base_package = "Products.CMFPlone"
publish = false

[frontend]
path = "frontend"

[frontend.package]
name = "fake-distribution"
path = "frontend/packages/fake-distribution"
changelog = "frontend/packages/fake-distribution/CHANGELOG.md"
towncrier_settings = "frontend/packages/fake-distribution/towncrier.toml"
publish = false

List Available Commands

To see all available commands, run:

uvx repoplone

Check Installed Version

To check the installed version of the tool, use:

uvx repoplone --version

Check repository versions

List current versions for:

  • Repository
  • Backend package
  • Frontend package
uvx repoplone versions

Releasing Monorepo Packages

The release process consists of two subcommands:

  • changelog – Generates a draft changelog for review.
  • do – Performs the package release.

Generate Changelog

To generate and display the draft changelog, run:

uvx repoplone release changelog

Perform Release

The do command creates a new release and accepts the following arguments:

version

The version argument defines the new version to be used in the release. It can be a specific version number or a version segment. Below is a reference table showing how version segments modify an existing 1.0.0 version:

Segment New Version
release 1.0.0
major 2.0.0
minor 1.1.0
micro / patch / fix 1.0.1
a / alpha 1.0.0a0
b / beta 1.0.0b0
c / rc / pre / preview 1.0.0rc0
r / rev / post 1.0.0.post0
dev 1.0.0.dev0

--dry-run

Use this flag to simulate the release process without actually publishing the new version.

Example:

uvx repoplone release do a

This will create an alpha release.


Dependencies

Manage backend's base package

The following commands are available exclusively for projects managed by UV and with a base_package set in the [backend.package] section of repository.toml.

Report the base package

To check which is the current base package, run:

uvx repoplone deps info

Check version

To check the current base package version, run:

uvx repoplone deps check

Upgrade version

To upgrade the base package to a specific version, use:

uvx repoplone deps upgrade 6.1.1

Contribute 🤝

We welcome contributions to RepoPlone.

You can create an issue in the issue tracker, or contact a maintainer.

Development requirements

Setup

Clone this repository:

git clone git@github.com:plone/repoplone.git

Install UV, and create a local virtual environment with the following command.

make install

Run the checked out branch of RepoPlone

uv run repoplone

Check and format the codebase

make check

Run tests

pytest is this package's test runner.

Run all tests with the following command.

make test

Run all tests, but stop on the first error and open a pdb session with the following command.

uv run pytest -x --pdb

Run only tests that match test_release_backend with the following command.

uv run pytest -k test_release_backend

Run only tests that match test_release_backend, but stop on the first error and open a pdb session with the following command.

uv run pytest -k test_release_backend -x --pdb

Run type checker

We use mypy to run static type checking for this codebase.

Run the checker with the following command.

uv run mypy src

Support 📢

For support, questions, or more detailed documentation, visit the official RepoPlone repository.

This project is supported by

Plone Foundation Logo

License

The project is released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repoplone-1.0.0a1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repoplone-1.0.0a1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file repoplone-1.0.0a1.tar.gz.

File metadata

  • Download URL: repoplone-1.0.0a1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.13

File hashes

Hashes for repoplone-1.0.0a1.tar.gz
Algorithm Hash digest
SHA256 07fbe3b1cd26be3e1c7095e571830e19e7ca0dc3804f9403879c8df038221849
MD5 cef57e913f517c9273739f5f5fbb9eae
BLAKE2b-256 8cb307fe74bac97db237951c10242e21e7409bfd1094612849b5460d19aee41a

See more details on using hashes here.

File details

Details for the file repoplone-1.0.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for repoplone-1.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e40c1b7ddfc7217f8e75118db0c899e975e3b6f879f1526a83c3da71326f6e6
MD5 76879fe22420c2b202e37755ca012e41
BLAKE2b-256 b2a5b723f53fe7024bc0f1434c4157d11ec8e65a53b11bf3f7c5f7eee44ef816

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page