Skip to main content

the blessed package to manage your versions by scm tags

Project description

setuptools_scm

github ci 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 60 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>=60",
    "setuptools-scm>=8.0"]

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

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

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.0.1.tar.gz (71.8 kB view details)

Uploaded Source

Built Distribution

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

setuptools_scm-8.0.1-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file setuptools-scm-8.0.1.tar.gz.

File metadata

  • Download URL: setuptools-scm-8.0.1.tar.gz
  • Upload date:
  • Size: 71.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for setuptools-scm-8.0.1.tar.gz
Algorithm Hash digest
SHA256 e69bf0b8265fdc8f4e070c98235b1b0816ffa8b7f91153400404bf68496012e3
MD5 dc2561d92d9f165efdaee7642176a531
BLAKE2b-256 a7168aef42ae27036ceb201f1774940357da18ae7daac45bdd721da554892012

See more details on using hashes here.

File details

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

File metadata

  • Download URL: setuptools_scm-8.0.1-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for setuptools_scm-8.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c132f5a8dc508c8113f865c709041d1b15f7d500442220174c38397607797a91
MD5 cc69449fc95907677ad91327a45a2d07
BLAKE2b-256 d473ccf02298d1982cd27c30b3ada350d9952800a38b45bb0cbdb7c7b0110edc

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