Skip to main content

A tool to help releasing projects.

Project description

project-release

A tool to help releasing projects.

Installation

With pip:

pip install project-release

Usage

  • Inside your project, create a file .project-release-config.yaml
  • A very basic configuration can be generated with project-release sample-config
  • All other options are documented below
  • Once configured, a project can be released by executing project-release

Configuration

The file .project-release-config.yaml is used for the configuration.

Conventions

The project can indicate that it follows certain conventions.

Version format

The version string can be limited to some standards:

convention:
  version: semver

When not defined, the user-specified version string is unrestricted.

File update

The project can indicate that some files need to be updated.

Version file

The version files can be updated in many different ways.

  • If it contains only the version string the configuration will look like:
    file:
      version: VERSION
    
  • If something more complex is needed, it can be formatted. The current version string is available with the format specifier %(version)s :
    file:
      version:
        path: VERSION
        format: 'version %(version)s'
    
  • The multi-line YAML format can also be used:
    file:
      version:
        path: VERSION
        format: |
          # Autogenerated version file
          VERSION="%(version)s"
    
  • If the file is to be updated only, a pattern can be used. All matches will be replaced by the new version string:
    file:
      version:
        path: VERSION
        pattern: '(?<=version ).*'
    
  • Finally multiple version files can be configured:
    file:
      version:
        - version.plain
        - path: version.formatted
          format: 'version %(version)s'
        - path: version.updated
          pattern: '(?<=version ).*'
    

Git branches

The development branch and release branch can be configured, so that commit from the development branch are merged in the release branch prior to create the release.

git:
  branch:
    development: 'main'
    release: 'release'

The definition of these branches are optional. If both are omitted, the current branch is used for the release and no merge are done. If only one is omitted, the user will be asked to specify the missing one. Specifying a non-existent branch will create it.

Branch pattern can be configured using the wildcards * and ?. In this case the user will be asked to specify the branch. The specified branch must match the pattern.

git:
  branch:
    development: 'main'
    release: 'stable-*'

The branches can be configured with a list a names and patterns.

git:
  branch:
    development: 'main'
    release:
      - 'release'
      - 'stable-*'

Git commit

After the merge. If some file as been updated using the file keyword, a commit will be created on the release branch. Some basic things can be configured:

git:
  commit:
    message: 'bump: version %(version)s'
    sign-off: true
    gpg-sign: true

Git tag

After the merge and the commit, a tag is created on the release branch. Some basic things can be configured:

git:
  tag:
    format: 'v%(version)s'
    message: 'version %(version)s'
    annotate: true
    gpg-sign: true

Advanced option

Status

At any time, the project-release --status command can be used to get an overview of the current status of the release process.

Custom commit

After the merge, if a custom commit is needed before the bump commit, the project-release --edit command can be used. The procedure will stop to let the user perform the custom commit. Use the project-release --continue command to terminate the procedure.

Merge conflicts

If the git merge is not successful, the initial project-release command will stop, asking the user to resolve any conflicts.

Once the work is done (committed or staged), the project-release --continue command can be used to continue the release process.

At any time, the project-release --abort command can be used to interrupt the release process.

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

project_release-0.0.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

project_release-0.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file project_release-0.0.0.tar.gz.

File metadata

  • Download URL: project_release-0.0.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for project_release-0.0.0.tar.gz
Algorithm Hash digest
SHA256 67da08e2e1bfa70e91665e847f04c8a7f757e6429255394f3af131eb8e9b068d
MD5 fa45d29dd61d51570ef1caae79e89b73
BLAKE2b-256 e323775dd29ce94c233c6671b18eec7d91f738a729b3caf30c5fc3e9f2d39c38

See more details on using hashes here.

File details

Details for the file project_release-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for project_release-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43e7646eec1148f61e9a6707918c82779ecae477bbfa5c1af8b5efe6681e4e30
MD5 01c7fc6c6d74d67b5231c313db0174fa
BLAKE2b-256 8a378d818956240740626313cb01c9dba08201f62e0d6ffecf40d1562a15fb2b

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