Skip to main content

Automatically set package version from VCS.

Project description

setuptools-vcs-version

Automatically sets package version from VCS. This is based on dunamai and inspired by better-setuptools-git-version.

Introduction

Instead of hard-coding the package version in setup.py like:

setup(
    name='foobar',
    version='1.0',
    ...
)

this package allows to extract it from tags in the underlying most popular VCS repository:

setup(
    name='foobar',
    version_config={
        "starting_version": "0.1.0",
        "version_style": {
            "style": "pep440",
            "metadata": True,
            "dirty": True,
        },
    },
    setup_requires=['setuptools-vcs-version'],
    ...
)

The tool uses the dunamai to render package version and thus supports most popular VCS and following version styles: pep440, semver, pvp . PEP440 is default and may be omitted. See more about dunamai features. If there are no any VCS, the version specified by starting_version will be used.

Note that the "v" prefix on the tag is required, unless you specify a different tag style with pattern in the version_config.

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

setuptools-vcs-version-0.9.2.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distributions

setuptools_vcs_version-0.9.2-py3.8.egg (3.7 kB view hashes)

Uploaded Source

setuptools_vcs_version-0.9.2-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

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