Oh jeez, it seems like specifying a local git tag v0.1.0
worked… is
git
required for Python package versioning?
No.
I wire a version directly into my setup.py, and that version does not
come from git.
Maybe this is some convenient behaviour if there’s no valid version=
for setup().
Why does python setup.py sdist
ignore whatever version is in
setup.cfg
and instead use the local git tag?
I think something else is going on. If you haven’t sorted your version
issue from the previous post, that may be why it has no effect.
Please show us your setup.py
file. Here’re a working example from my
end. You can see that the version is just a string. It has to conform to
the version spec of course.
#!/usr/bin/env python
from setuptools import setup
setup(
name = 'cs.x',
author = 'Cameron Simpson',
author_email = 'cs@cskk.id.au',
version = '20211208',
url = 'https://bitbucket.org/cameron_simpson/css/commits/all',
description =
'X(), for low level debugging.',
long_description =
'X(), for low level debugging.\n ...... long description snipped .....',
install_requires = ['cs.ansi_colour'],
classifiers = ['Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Topic :: Software Development :: Libraries :: Python Modules', 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)'],
keywords = ['python2', 'python3'],
license = 'GNU General Public License v3 or later (GPLv3+)',
long_description_content_type = 'text/markdown',
package_dir = {'': 'lib/python'},
py_modules = ['cs.x'],
)
Cheers,
Cameron Simpson cs@cskk.id.au