From 40f821a52a6fbda0b67ab6460cc644e44250f07e Mon Sep 17 00:00:00 2001 From: Miro HronĨok Date: Jan 19 2022 14:51:47 +0000 Subject: Python: Add a warning about git tarballs and setuptools_scm --- diff --git a/guidelines/modules/ROOT/pages/Python.adoc b/guidelines/modules/ROOT/pages/Python.adoc index 0cb0c12..5768573 100644 --- a/guidelines/modules/ROOT/pages/Python.adoc +++ b/guidelines/modules/ROOT/pages/Python.adoc @@ -1136,6 +1136,20 @@ When using sources from PyPI, you can use the <> to generate the proper URL. +WARNING: Some Python packages use metadata from `git` +(or a similar version control system) +to construct their version string, +for example via https://pypi.org/project/setuptools-scm/[setuptools_scm]. +When publishing a package to PyPI, +this version metadata is usually stored and included in a file, +so the version control history is no longer needed to construct it. +However, when using tarballs from a git forge directly, +this version information is missing +and must be manually provided by the packager. +For example, the `SETUPTOOLS_SCM_PRETEND_VERSION` environment variable can be set +to the desired value in the `+%generate_buildrequires+` and `+%build+` scripts in the spec file +for packages that use `setuptools_scm` for this purpose. + == Example spec file[[_example_python_spec_file]] The following is a viable spec file