Skip to main content

This code is licensed under the MIT license.

This is a suite of tools that are useful for releasing Python code for public or private use. There are setuptools extensions to validate various conventions and to perform release activities.

Installation and Usage

This package is generally not installed directly but instead listed in the setup_requires option of the setuptools setup function. For example:

from setuptools import setup

setup(
    name="my_clever_package",
    version="1.0.0",
    setup_requires=[
        "py_release_tools",
    ]
)

Commands are exported as distuils commands and should be automatically available provided the package is installed. The tool provides the commands documented below and are generally run by defining a release alias in the project’s setup.cfg file. The author’s typical project setup.cfg contains these aliases:

[aliases]
validate = cover_tests pep8
release = validate increment_semver git_push sdist upload
release_major = validate increment_semver -M git_push sdist upload
release_minor = validate increment_semver -m git_push sdist upload

Commands

increment_semver

This command will update the setup.py file version number following the rules of Semantic Versioning (semver). This command will re-write and commit the project’s setup.py file. It assumes that the version line is formatted as such, with some amount of leading whitespace:

version="1.20.1"

It will rewrite all lines that look like this in the file.

The version format is:

MAJOR.MINOR.PATCH

For more information check out the semver docs.

Version generation increments a version component by one. By default a patch version is generated. Passing the -m or --minor flags to the command will increment the minor version and set the patch version to zero. Passing -M or --major will increment the major version and set both the minor and patch versions to zero.

This command will also create a tag in the git repository of format release-{semver}.

git_push

This command runs a git push command to push the master branch to the remote origin. The command will also push tags. If your git repository doesn’t use these naming conventions the command will fail.

cover_tests

This command will setup python coverage monitoring and invoke the setuptools test target. Coverage data will be written to .coverage in the same directory as the setup.py file.

This command will also generate a Cobertura coverage report as coverage.xml and an HTML report in the htmlcov folder.

Failure of the tests will cause a failure of the build so it is suitable to use this command as a replacement for the builtin test command. This command also suppresses the system exit that the builtin test command generates so other commands can be chained after this one.

pep8

This command will run a PEP8 code style validation on all Python files in the project, including the setup.py file.

Contributing

If you would like to contribute to Pydora please visit the project’s GitHub page and open a pull request with your changes. To have the best experience contributing, please:

  • Don’t break backwards compatibility of public interfaces

  • Write tests for your new feature/bug fix

  • Ensure that existing tests pass

  • Update the readme/docstrings, if necessary

  • Follow the coding style of the current code-base

  • Ensure that your code is PEP8 compliant

  • Validate that your changes work with Python 2.7+ and 3.x

All code is reviewed before acceptance and changes may be requested to better follow the conventions of the existing API.

he build system runs python setup.py validate on all supported Python versions. You can, and should, run this on your pull request before submitting.

Metadata

Release files for py_release_tools 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py_release_tools 0.1.3
File Size Uploaded Provenance
py_release_tools-0.1.3.tar.gz 4.9 kB Without provenance Details

Release files / py_release_tools-0.1.3.tar.gz

Download URL py_release_tools-0.1.3.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d971ad236bbb9f865b8047f6ff0e21dd68950d4ee3ad8899deee821a0d23f6e7
BLAKE2b-256 checksum
How to use checksums
9a9dad787211c9b54cb359d2acf6d1ff03ddff3a6f160cf31ff6e4f032d64137
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for py_release_tools 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page