I am trying to create a snapshot/daily build of my Python package, using Setuptools and Build (the PEP 517 build module).
I have tried adapting this section of the Setuptools documentation: https://setuptools.pypa.io/en/latest/userguide/distribution.html#tagging-and-daily-build-or-snapshot-releases
However, none of the following commands worked:
python -m build --config-setting=--tag-date myproject
python -m build --config-setting=tag-date myproject
python -m build --tag-date myproject
The first two build the package without the version tag, while the third is an error. The results are the same when I use --tag-build instead of --tag-date.
How can I tell Setuptools to add the version tag, if none of the above options work?
I do not have a setup.py, only a setup.cfg. I cannot use setup.py bdist_wheel --tag-date, this command will say "File not found" because setup.py does not exist in my project.
EDIT after searching through Setuptools issue tracker, I also tried the following commands, with no success:
python -m build --config-setting=--global-options=--tag-date myproject
python -m build --config-setting=--global-options=tag-date myproject
python -m build --config-setting=global-options=--tag-date myproject
python -m build --config-setting=global-options=tag-date myproject
Digging through the
setuptoolscode, it looks like the--tag-dateand the--tag-buildoptions are available if passed toegg_info.Example:
As for combining
setuptoolswithbuild, you were almost there, it's just that you had to chainegg_infoand--tag-datetogether:Note that
--tag-datedoesn't take any value, it will just add date stamp (e.g. 20050528) to version numberResources:
Source code for setuptools: https://github.com/pypa/setuptools/blob/00fbad0f93ffdba0a4d5c3f2012fd7c3de9af04d/setuptools/command/egg_info.py#L159
Package version: