Code Monkey home page Code Monkey logo

setuptools_scm's Introduction

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.

setuptools_scm's People

Contributors

ronnypfannschmidt avatar pre-commit-ci[bot] avatar jaraco avatar ikerreyes avatar sbidoul avatar paugier avatar henryiii avatar abravalheri avatar puxlit avatar schang412 avatar hugovk avatar userzimmermann avatar jamesbraza avatar webknjaz avatar engnadeau avatar ionelmc avatar untitaker avatar flying-sheep avatar mr-rodgers avatar con-f-use avatar blueyed avatar layday avatar chrisjbillington avatar stephenfin avatar mgorny avatar mindw avatar flameeyes avatar anntzer avatar gesslerpd avatar pythonicninja avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.