Package: zest.releaser
Package releasing made easy: zest.releaser overview and installationzest.releaser is collection of command-line programs to help you automate the
task of releasing a Python project.It does away with all the boring bits. This is what zest.releaser automates
for you:It updates the version number. The version number can either be insetup.pyorversion.txtor in a__version__attribute in a
Python file or insetup.cfg. For example, it switches you from0.3.dev0(current development version) to0.3(release) to0.4.dev0(new development version).It updates the history/changes file. It logs the release date on release and
adds a new heading for the upcoming changes (new development version).It tags the release. It creates a tag in your version control system named
after the released version number.It optionally uploads a source release to PyPI. It will only do this if the
package is already registered there (else it will ask, defaulting to ‘no’);
zest releaser is careful not to publish your private projects!Most important URLsFirst the three most important links:The full documentation is atzestreleaser.readthedocs.io.We’reon PyPI, so we’re only
anpip install zest.releaseraway from installation on your computer.The code is atgithub.com/zestsoftware/zest.releaser.Compatibility / Dependencieszest.releaserworks on Python 3.8+, including PyPy3.
Tested until Python 3.11, but seetox.inifor the canonical place for that.To be sure: the packages that you release withzest.releasermay
very well work on other Python versions: that totally depends on your
package.We depend on:setuptoolsfor the entrypoint hooks that we offer.coloramafor colorized output (some errors printed in red).twinefor secure uploading via https to pypi. Plain setuptools doesn’t
support this.Since version 4.0 there is arecommendedextra that you can get by
installingzest.releaser[recommended]instead ofzest.releaser.  It
contains a few trusted add-ons that we feel are useful for the great majority
ofzest.releaserusers:wheelfor creating a Python wheel that we upload to PyPI next to
the standard source distribution.  Wheels are the official binary
distribution format for Python.
Since version 8.0.0a2 we always create wheels, except when you
explicitly switch this off in the config:create-wheel= false.
If you are sure you want “universal” wheels, follow the directions from thewheel documentation.check-manifestchecks yourMANIFEST.infile for completeness,
or tells you that you need such a file.  It basically checks if all
version controlled files are ending up the the distribution that we
will upload.  This may avoid ‘brown bag’ releases that are missing
files.pyromachecks if the package follows best practices of Python
packaging.  Mostly it performs checks on thesetup.pyfile, like
checking for Python version classifiers.readme_rendererto check your long description in the same way as pypi does. No more
unformatted restructured text on your pypi page just because there was a
small error somewhere. Handy.InstallationJust a simplepip install zest.releaseroreasy_install zest.releaseris
enough. If you want the recommended extra utilities, do apip install zest.releaser[recommended].Alternatively, buildout users can install zest.releaser as part of a specific
project’s buildout, by having a buildout configuration such as:[buildout]
parts =
    scripts

[scripts]
recipe = zc.recipe.egg
eggs = zest.releaser[recommended]Version control systems: gitOf course you must have a version control system installed.
Since version 7, zest.releaser only supports git.If you use Subversion (svn), Mercurial (hg), Git-svn, or Bazaar (bzr), please use version 6.
If you really want, you can probably copy the relevant parts from the old code to a new package,
and release this as an add-on package for zest.releaser.
I suspect that currently it would only work with a monkey patch.
If you are planning something, please open an issue, and we can see about making this part pluggable.Available commandsZest.releaser gives you four commands to help in releasing python
packages.  They must be run in a version controlled checkout.  The commands
are:prerelease: asks you for a version number (defaults to the current
version minus a ‘dev’ or so), updates the setup.py or version.txt and the
CHANGES/HISTORY/CHANGELOG file (with either .rst/.txt/.md/.markdown or no
extension) with this new version number and offers to commit those changes
to subversion (or bzr or hg or git).release: copies the the trunk or branch of the current checkout and
creates a version control tag of it.  Makes a checkout of the tag in a
temporary directory.  Offers to register and upload a source dist
of this package to PyPI (Python Package Index).  Note: if the package has
not been registered yet, it will not do that for you.  You must register the
package manually (python setup.py register) so this remains a conscious
decision.  The main reason is that you want to avoid having to say: “Oops, I
uploaded our client code to the internet; and this is the initial version
with the plaintext root passwords.”postrelease: asks you for a version number (gives a sane default), adds
a development marker to it, updates the setup.py or version.txt and the
CHANGES/HISTORY/CHANGELOG file with this and offers to commit those changes
to version control. Note that with git and hg, you’d also be asked to push
your changes (since 3.27). Otherwise the release and tag only live in your
local hg/git repository and not on the server.fullrelease: all of the above in order.Note: markdown files should use the “underline” style of headings, not the
“atx” style where you prefix the headers with#signs.There are some additional tools:longtest: small tool that renders the long description and opens it in a
web browser. Handy for debugging formatting issues locally before uploading
it to pypi.lasttagdiff: small tool that shows thediffof the current
branch with the last released tag.  Handy for checking whether all
the changes are adequately described in the changes file.lasttaglog: small tool that shows thelogof the current
branch since the last released tag.  Handy for checking whether all
the changes are adequately described in the changes file.addchangelogentry: pass this a text on the command line and it
will add this as an entry in the changelog.  This is probably mostly
useful when you are making the same change in a batch of packages.
The same text is used as commit message.  In the changelog, the text
is indented and the first line is started with a dash.  The command
detects it if you use for example a star as first character of an
entry.bumpversion: do not release, only bump the version.  A
development marker is kept when it is there.  With--featurewe
update the minor version.  With option--breakingwe update the
major version.CreditsReinout van Rees(Nelen & Schuurmans) is the
original author. He’s still maintaining it, together with Maurits.Maurits van Rees(Zest Software) added
a heapload of improvements and is the maintainer, together with Reinout.Kevin Teague(Canada’s Michael Smith Genome Sciences
Center) added support for multiple version control systems, most notable
Mercurial.Wouter vanden Hove(University of Gent) added
support for uploading to multiple servers, using collective.dist.Godefroid Chapelle(BubbleNet) added /tag besides
/tags for subversion.Richard Mitchell(Isotoma) added Python 3 support.Mateusz Legięckiadded a dockerfile for
much easier testing.Eli Salléadded pyproject.toml support
for zest.releaser’s own options. We’re modern now!Changelog for zest.releaser9.1.3 (2024-02-07)Fix to the project setup.tox.iniusesextras =instead ofdeps =to to
install the test extras.
[mtelka]9.1.2 (2024-02-05)If you want to build a release package (release=true, the default), but don’t want to
actually upload it, you can now set theupload-pypioption to false (default is
true).
[leplatrem]9.1.1 (2023-10-11)When reading~/.pypircconfig, readsetup.cfgas well, as it might
override some of these values, like[distutils]index-servers.
Fixes issue #436.  [maurits]9.1.0 (2023-10-03)Using newer ‘build’ (>=1.0.0) including a slight API change, fixes
#433. [reinout]Typo fix in the readme: we look at__version__instead of
the previously-documented__versions__… [reinout]9.0.0 (2023-09-11)Make final release.  Nothing changed since the last beta.  [maurits]9.0.0b1 (2023-07-31)When a command we call exits with a non-zero exit code, clearly state this in the output.
Ask the user if she wants to continue or not.
Note that this is tricky to do right.  Some commands likegitseem to print everything to stderr,
leading us to think there are errors, but the exit code is zero, so it should be fine.
We do not want to ask too many questions, but we do not want to silently swallow important errors either.
[maurits]9.0.0a3 (2023-07-25)Updated contributors list.Documentinghook_package_dirsetting for entry points (which isn’t
needed for most entry points, btw).
Fixesissue 370.Allowing for retry forgit push, which might fail because of a protected
branch. Also displaying that possible cause when it occurs. Fixesissue 385.9.0.0a2 (2023-07-19)Ignore error output when callingbuild.
We only need to look at the exit code to see if it worked.
You can call zest.releaser with--verboseif you want
to see the possible warnings.Removedencodingconfig option as nobody is using it anymore (using the
option would result in a crash). Apparently it isn’t needed anymore now that
we don’t use python 2 anymore. Fixesissue 391.Thelongtestis now simpler. It runs readme_renderer and just displays
the result in the browser, without error handling.twine checkshould be
used if you want a real hard check (longtest--headlessis
deprecated). The advantage is that longtest now also renders markdown
correctly.  This addsreadme_renderer[md]as dependency.
Fixesissue 363.9.0.0a1 (2023-07-13)Changed build system to pypa/build instead of explicitly using
setuptools.Zest.releaser’s settings can now also be placed inpyproject.toml.Use native namespace packages forzest.releaser, instead of
deprecatedpkg_resourcesbased ones.Added pre-commit config for neater code (black, flake8, isort).Dropped support for python 3.7. Together with switching tobuildandpyproject.toml, this warrants a major version bump.8.0.0 (2023-05-05)Make final release, no changes since latest alpha.  [maurits]8.0.0a2 (2023-04-06)Always create wheels, except when you explicitly switch this off in the config:[zest.releaser]create-wheel= no.
If thewheelpackage is not available, we still do not create wheels.
Fixesissue 406.
[maurits]Do not fail when tag versions cannot be parsed.
This can happen inlasttaglog,lasttagdiff, andbumpversion, withsetuptools66 or higher.
Fixesissue 408.
[maurits]8.0.0a1 (2023-02-08)Drop support for Python 3.6.  [maurits]Support reading and writing the version inpyproject.toml.
Seeissue 295,issue 373,
andPEP-621,
[maurits]7.3.0 (2023-02-07)Add optionrun-pre-commit= yes / no.
Default: no.
When set to true, pre commit hooks are run.
This may interfere with releasing when they fail.
[maurits]7.2.0 (2022-12-09)Auto-detecthistory_formatbased on history filename.
[ericof]Addhistory_formatoption, to explicitly set changelogs
entries in Markdown.
[ericof]7.1.0 (2022-11-23)Add thebumpversionoptions to thepostreleasecommand.
This meansfeature,breaking, andfinal.
[rnc, maurits]Add--finaloption tobumpversioncommand.
This removes alpha / beta / rc markers from the version.
[maurits]Add support for Python 3.11, removez3c.testsetupfrom test dependencies.  [maurits]7.0.0 (2022-09-09)Optionally add prefix text to commit messages.  This can be used ensure your messages follow some regular expression.
To activate this, addprefix-message= [TAG]to a[zest.releaser]section in thesetup.cfgof your package, or your global~/.pypirc.  Or add your favorite geeky quotes there.
[LvffY]7.0.0a3 (2022-04-04)Bug 381: Inprerelease, check withpep440if the version is canonical.
Addedpep440to therecommendedextra, not to the core dependencies:zest.releasercan also be used for non-Python projects.
[maurits]7.0.0a2 (2022-02-10)Add--headlessoption tolongtest.7.0.0a1 (2021-12-01)Big cleanup to ease future development:Removed support for Subversion (svn), Bazaar (bzr), Mercurial (hg).Removed support for Python 2 and 3.5.Added support for Python 3.9 and 3.10.Tested with Python 3.6-3.10 plus PyPy3.Switched from Travis to GitHub Actions.Simplified running commands by usingsubprocess.run.