Using source control metadata in setup.py

suggest change

setuptools-scm can use Git or Mercurial metadata to determine the version number of your package, and find Python packages and package data to include in it.

from setuptools import setup, find_packages

setup(
    setup_requires=['setuptools_scm'],
    use_scm_version=True,
    packages=find_packages(),
    include_package_data=True,
)

This example uses both features; to only use SCM metadata for the version, replace the call to find_packages() with your manual package list, or to only use the package finder, remove use_scm_version=True. An isolated build does not install setup_requires. Also list setuptools-scm under [build-system] requires in pyproject.toml.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents