setuptools-scm 8.3.1


pip install setuptools-scm

  Latest version

Released: Apr 23, 2025


Meta
Author: Ronny Pfannschmidt
Requires Python: >=3.8

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Programming Language
  • Python
  • Python :: 3 :: Only
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13

Topic
  • Software Development :: Libraries
  • Software Development :: Version Control
  • System :: Software Distribution
  • Utilities

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.

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.

8.3.1 Apr 23, 2025
8.3.0 Apr 22, 2025
8.2.1 Mar 19, 2025
8.2.0 Feb 21, 2025
8.1.0 May 06, 2024
8.0.4 Oct 02, 2023
8.0.3 Sep 22, 2023
8.0.2 Sep 21, 2023
8.0.1 Sep 20, 2023
8.0.0 Sep 20, 2023
7.1.0 Dec 17, 2022
7.0.5 Jul 11, 2022
7.0.4 Jul 01, 2022
7.0.3 Jun 29, 2022
7.0.2 Jun 22, 2022
7.0.1 Jun 21, 2022
7.0.0 Jun 21, 2022
6.4.2 Jan 19, 2022
6.4.1 Jan 18, 2022
6.4.0 Jan 17, 2022
6.3.2 Sep 11, 2021
6.3.1 Sep 03, 2021
6.3.0 Sep 03, 2021
6.2.0 Aug 27, 2021
6.1.1 Aug 27, 2021
6.1.0 Aug 26, 2021
6.1.0.dev0 Aug 26, 2021
6.0.1 Mar 17, 2021
6.0.0 Mar 17, 2021
5.0.2 Mar 04, 2021
5.0.1 Dec 13, 2020
5.0.0 Dec 12, 2020
4.1.2 May 31, 2020
4.1.1 May 26, 2020
4.1.0 May 25, 2020
4.0.0 May 24, 2020
3.5.0 Feb 13, 2020
3.4.3 Jan 22, 2020
3.4.2 Jan 19, 2020
3.4.1 Jan 18, 2020
3.4.0 Jan 17, 2020
3.3.3 May 12, 2019
3.3.2 May 12, 2019
3.3.1 May 10, 2019
3.2.0 Jan 16, 2019
3.1.0 Aug 09, 2018
3.0.6 Jul 31, 2018
3.0.5 Jul 30, 2018
3.0.4 Jul 28, 2018
3.0.2 Jul 23, 2018
3.0.1 Jul 23, 2018
3.0.0 Jul 23, 2018
2.1.0 May 13, 2018
2.0.0 Apr 10, 2018
1.17.0 Mar 20, 2018
1.16.2 Mar 20, 2018
1.16.1 Mar 19, 2018
1.16.0 Mar 19, 2018
1.15.7 Jan 19, 2018
1.15.6 Jun 15, 2017
1.15.5 Apr 08, 2017
1.15.4 Apr 08, 2017
1.15.1rc1 Jan 26, 2017
1.15.0 Oct 20, 2016
1.15.0rc1 Oct 20, 2016
1.14.0 Oct 12, 2016
1.14.0rc1 Oct 12, 2016
1.13.1 Oct 11, 2016
1.13.0 Oct 05, 2016
1.11.1 Jun 12, 2016
1.11.0 Apr 06, 2016
1.10.1 Dec 10, 2015
1.10.0 Dec 07, 2015
1.9.0 Nov 12, 2015
1.8.0 Sep 17, 2015
1.7.0 Aug 12, 2015
1.6.0 Jul 22, 2015
1.5.5 Jul 07, 2015
1.5.4 Jun 13, 2015
1.5.3 Jun 11, 2015
1.5.2 May 30, 2015
1.5.0 May 30, 2015
1.4.1 May 21, 2015
1.4.0 May 21, 2015
1.3.0 Mar 14, 2015
1.2.0 Feb 26, 2015
1.1.0 Feb 24, 2015
1.0.0 Feb 23, 2015
0.0rc0 Oct 12, 2016

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
packaging (>=20)
setuptools
tomli (>=1)
typing-extensions
importlib-metadata (>=4.6)