Skip to main content

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 a Source Code Managed (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 the SCM-managed files to the sdist).
Unwanted files must be excluded via MANIFEST.in or configuring Git archive.

⚠️ Important: Installing setuptools-scm automatically enables a file finder that includes all SCM-tracked files in your source distributions. This can be surprising if you have development files tracked in Git/Mercurial that you don't want in your package. Use MANIFEST.in to exclude unwanted files. See the documentation for details.

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 (recommended: >=80 for best compatibility). 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>=80", "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]

!!! note "Simplified Configuration"

Starting with setuptools-scm 8.1+, if `setuptools_scm` (or `setuptools-scm`) is
present in your `build-system.requires`, the `[tool.setuptools_scm]` section
becomes optional! (In 9.2+, this requires the `simple` extra.) You can now
enable setuptools-scm with just:

```toml title="pyproject.toml"
[build-system]
requires = ["setuptools>=80", "setuptools-scm[simple]>=9.2"]
build-backend = "setuptools.build_meta"

[project]
dynamic = ["version"]
```

The `[tool.setuptools_scm]` section is only needed if you want to customize
configuration options.

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.

!!! note "Legacy Setuptools Support" While setuptools-scm recommends setuptools >=80, it maintains compatibility with setuptools 61+ to support legacy deployments that cannot easily upgrade. Support for setuptools <80 is deprecated and will be removed in a future release. This allows enterprise environments and older CI/CD systems to continue using setuptools-scm while still encouraging adoption of newer 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.

Release files for setuptools-scm 10.3.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 setuptools-scm 10.3.3
File Size Uploaded
setuptools_scm-10.3.3.tar.gz 77.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for setuptools-scm 10.3.3
File Interpreter ABI Platform
setuptools_scm-10.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 110.4 kB

Release files / setuptools_scm-10.3.3.tar.gz

Download URL setuptools_scm-10.3.3.tar.gz
Size 77.4 kB
Tags Source
SHA-256 checksum
How to use checksums
67755d260cd70d470d44410a6416d3014c579a78a47c86fe1c03f0b7c0d30864
BLAKE2b-256 checksum
How to use checksums
fb29d65c688c20917a32a87899a9300db21ae5382b3c1c1cca8adf6e5a318828
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / setuptools_scm-10.3.3-py3-none-any.whl

Download URL setuptools_scm-10.3.3-py3-none-any.whl
Size 33.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2aa1774b1a240c74ef05559d81952010fbae4babcd622a5aea9e6be67f106c02
BLAKE2b-256 checksum
How to use checksums
22d2136ad68eab6735f8ad57a6c7d9ff330df7b8928c72e72294088fb1fe5028
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

10.3.4

2 release files

This release

10.3.3 This release

2 release files

10.3.2

2 release files

10.3.1

2 release files

10.3.0

2 release files

10.2.1

2 release files

10.2.0

2 release files

10.1.2

2 release files

10.1.1

2 release files

10.0.5

2 release files

10.0.4

2 release files

10.0.3

2 release files

10.0.2

2 release files

10.0.1

2 release files

9.2.2

2 release files

9.2.1

2 release files

9.2.0

2 release files

9.1.1

2 release files

9.1.0

2 release files

9.0.3

2 release files

9.0.2

2 release files

9.0.1

2 release files

9.0.0

2 release files

8.3.1

2 release files

8.3.0

2 release files

8.2.1

2 release files

8.2.0

2 release files

8.1.0

2 release files

8.0.4

2 release files

8.0.3

2 release files

8.0.2

2 release files

8.0.1

2 release files

8.0.0

2 release files

7.1.0

2 release files

7.0.5

2 release files

7.0.4

2 release files

7.0.3

2 release files

7.0.2

2 release files

7.0.1

2 release files

7.0.0

2 release files

6.4.2

2 release files

6.4.1

2 release files

6.4.0

2 release files

6.3.2

2 release files

6.3.1

2 release files

6.3.0

2 release files

6.2.0

2 release files

6.1.1

2 release files

6.1.0

2 release files

6.0.1

2 release files

6.0.0

2 release files

5.0.2

8 release files

5.0.1

8 release files

5.0.0

8 release files

4.1.2

8 release files

4.1.1

8 release files

4.1.0

8 release files

4.0.0

8 release files

3.5.0

7 release files

3.4.3

8 release files

3.4.2

8 release files

3.4.1

8 release files

3.4.0

8 release files

3.3.3

8 release files

3.3.2

6 release files

3.3.1

6 release files

3.2.0

6 release files

3.1.0

6 release files

3.0.6

6 release files

3.0.5

6 release files

3.0.4

6 release files

3.0.2

6 release files

3.0.1

6 release files

3.0.0

6 release files

2.1.0

6 release files

2.0.0

6 release files

1.17.0

6 release files

1.16.2

6 release files

1.16.1

6 release files

1.16.0

6 release files

1.15.7

7 release files

1.15.6

8 release files

1.15.0

8 release files

1.14.0

7 release files

1.13.1

2 release files

1.12.0

1.11.1

2 release files

1.10.1

3 release files

1.9.0

2 release files

1.8.0

3 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.5

1 release file

1.5.4

1 release file

1.5.3

1 release file

1.5.2

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

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