Skip to main content

Automates the process of releasing a new version of some software.

Project description

Easily write a script to release a new version, with variable steps.

Releasing software is a painful process. There are several checks that the developer must make for each new version. The developer is prone to forget one of them or perform the checks out of the optimal order. As Murphy would have it, many buggy releases are created for this reason.

releaser is a little framework the developer can use to write a script to guide him through the new version release process, such that many checks are performed automatically. (Each software project will have a release script that differs a little bit from others.)

Now that I use releaser I can release my Python libraries more quickly and easily, so I find that I release more often. Well worth the initial investment.

Many steps of a common Python release process have already been implemented, and you can easily write your own. If you do write a step, please donate it to the project by making a pull request on GitHub.

Installing releaser

Activate your virtualenv, then:

easy_install -UZ releaser

Getting started

Simply download this script to the root of your project:

curl -O https://raw.github.com/nandoflorestan/releaser/master/release_new_version.py
chmod +x ./release_new_version.py
git add release_new_version.py

Then edit the script as necessary. (You can read it here.)

When you execute the script, the configured steps are executed in order. The screen shows little information, but you have all details in the log file.

Some of the steps are interactive; for instance, you may be asked to verify the contents of a zip or wheel file before it is uploaded to pypi. releaser also makes you type the number of the version being released, which is then validated (for instance, it is compared to the current version), then written to a source code file that belongs to your project.

Rolling back

If any one of the steps fails, releaser asks you whether you would like it to rewind the process. (Yes, you get to decide.) How does this work?

A few of the steps (especially those involving git) have a rollback() method. For other steps (especially those that just check things at the beginning) rewinding wouldn’t make any sense since they don’t leave durable artifacts.

If your steps are correctly configured, rolling back leaves you exactly as you were before releaser ran. But:

Note the GitPush step has special behaviour. When it executes successfully but an error occurs in a later step, releaser decides NOT to roll back GitPush and the steps that preceded it. This is because one cannot delete git history once it has been pushed to a public server and GitPush tends to be one of the last steps anyway, so it is easier to finish the release manually than to deal with git history inconsistencies.

Other steps (such as creating a release on pypi) cannot be automatically rewinded for technical reasons, but releaser warns you that you have to do it manually before asking whether to roll back the release.

Breaking changes

Version 2.0.0

When you upgrade to this version you need to reposition 2 build steps.

releaser now uses twine to upload packages to pypi. There is no longer a need to build a test package before releasing. So these 2 steps which were preparation steps:

InteractivelyApproveDistribution, # Generate sdist, let user verify it InteractivelyApproveWheel, # Generate wheel, let user verify it

…are now expected to appear in the RELEASE (middle) part of your script. Move them down in the list of steps. In 1.x these steps built a test package; in 2.x they build the actual package that will be uploaded to pypi.

Refer to our updated example script. .. example script: https://raw.github.com/nandoflorestan/releaser/master/release_new_version.py

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

releaser-2.0.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

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

releaser-2.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file releaser-2.0.0.tar.gz.

File metadata

  • Download URL: releaser-2.0.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for releaser-2.0.0.tar.gz
Algorithm Hash digest
SHA256 3e16057ee1e1a740ecc2da3aaf2eba30cb52a3a3c60feb8f10aaad83d8c4e514
MD5 9d37d761c9b82e98a717bb2ed2099c39
BLAKE2b-256 fbace13aba9c09f8208e6311c5a42e54570a96c1309b9b741d4874b9c0b053cc

See more details on using hashes here.

File details

Details for the file releaser-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: releaser-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for releaser-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d529c050b634a70bd1639db4c982dc7ec94b6dd0b5181afc3c1b932cbd989fc1
MD5 8c08437fce4970b6a8efcf8c6ae08b1f
BLAKE2b-256 e10b368f4e9fffa99f38c9f46eecf6cabbff7b349fd2e54521138767e3f6d9cc

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