Skip to main content

the blessed package to manage your versions by scm tags

Project description

setuptools_scm

github ci Documentation Status tidelift

about

setuptools-scm extracts Python package versions from git or hg metadata instead of declaring them as the version argument or in an SCM managed file.

Additionally, setuptools-scm provides setuptools with a list of files that are managed by the SCM
(i.e. it automatically adds all of the SCM-managed files to the sdist).
Unwanted files must be excluded via MANIFEST.in.

pyproject.toml usage

The preferred way to configure setuptools-scm is to author settings in a tool.setuptools_scm section of pyproject.toml.

This feature requires setuptools 61 or later. First, ensure that setuptools-scm is present during the project's build step by specifying it as one of the build requirements.

[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

That will be sufficient to require setuptools-scm for projects that support PEP 518 like pip and build.

To enable version inference, you need to set the version dynamically in the project section of pyproject.toml:

[project]
# version = "0.0.1"  # Remove any existing version parameter.
dynamic = ["version"]

[tool.setuptools_scm]

Additionally, a version file can be written by specifying:

[tool.setuptools_scm]
version_file = "pkg/_version.py"

Where pkg is the name of your package.

If you need to confirm which version string is being generated or debug the configuration, you can install setuptools-scm directly in your working environment and run:

$ python -m setuptools_scm
# To explore other options, try:
$ python -m setuptools_scm --help

For further configuration see the documentation.

Interaction with Enterprise Distributions

Some enterprise distributions like RHEL7 ship rather old setuptools versions.

In those cases its typically possible to build by using an sdist against setuptools_scm<2.0. As those old setuptools versions lack sensible types for versions, modern setuptools-scm is unable to support them sensibly.

It's strongly recommended to build a wheel artifact using modern Python and setuptools, then installing the artifact instead of trying to run against old setuptools versions.

Code of Conduct

Everyone interacting in the setuptools-scm project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PSF Code of Conduct.

Security Contact

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Project details


Release history Release notifications | RSS feed

This version

8.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

setuptools_scm-8.1.0.tar.gz (76.5 kB view details)

Uploaded Source

Built Distribution

setuptools_scm-8.1.0-py3-none-any.whl (43.7 kB view details)

Uploaded Python 3

File details

Details for the file setuptools_scm-8.1.0.tar.gz.

File metadata

  • Download URL: setuptools_scm-8.1.0.tar.gz
  • Upload date:
  • Size: 76.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for setuptools_scm-8.1.0.tar.gz
Algorithm Hash digest
SHA256 42dea1b65771cba93b7a515d65a65d8246e560768a66b9106a592c8e7f26c8a7
MD5 d8046dce093a94dc382b68b45f6a6257
BLAKE2b-256 4fa400a9ac1b555294710d4a68d2ce8dfdf39d72aa4d769a7395d05218d88a42

See more details on using hashes here.

File details

Details for the file setuptools_scm-8.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for setuptools_scm-8.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 897a3226a6fd4a6eb2f068745e49733261a21f70b1bb28fce0339feb978d9af3
MD5 12c4718423c2576f507ae5f0385bb098
BLAKE2b-256 a0b91906bfeb30f2fc13bb39bf7ddb8749784c05faadbd18a21cf141ba37bff2

See more details on using hashes here.

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