Building Pre-releases with setup.cfg

Hi all,
I'm wondering if it is possibly to build pre-release tags using only a setup.cfg file? From https://setuptools.readthedocs.io/en/latest/userguide/distribution.html#tagg... it seems like this is possible via setup.py, but I was unable to find anything related to setup.cfg. An abridged version of my setup.cfg file looks like
[metadata] name = tester_project version = attr: tester_project.__version__
[bdist_wheel] universal=1
[build-system] requires = setuptools >= 40.9.0 wheel build-backend = setuptools.build_meta
Which I was building using
$ python -m build --sdist --wheel --outdir dist
Possibly this can be configured using the --config-setting flag but I have been unable to get this to work or find any documentation on it. Ideally I would be able to pass a string so I can build a dev version for testing uploads to Test PyPI, e.g. "0.0.1devHASH"
Any info or references is much appreciated!
Thanks, Matt

On 2021-02-09 09:48:31 -0500 (-0500), Matthew Gilbert wrote:
I'm wondering if it is possibly to build pre-release tags using only a setup.cfg file? From https://setuptools.readthedocs.io/en/latest/userguide/distribution.html#tagg... it seems like this is possible via setup.py, but I was unable to find anything related to setup.cfg.
[...]
Possibly this can be configured using the --config-setting flag but I have been unable to get this to work or find any documentation on it. Ideally I would be able to pass a string so I can build a dev version for testing uploads to Test PyPI, e.g. "0.0.1devHASH"
[...]
I'm probably misunderstanding your question, but typically I've seen something like PBR or Setuptools-SCM used to automatically calculate the version at dist build time (including inferring something based on the number of commits on the branch since the last tag, embedding abbreviated Git commit IDs, or whatever).
participants (2)
-
Jeremy Stanley
-
Matthew Gilbert