Closed pabs3 closed 1 year ago
Another option would be to not hard-code the version within _version.py
but instead load it from the PEP-0566 metadata by using importlib:
https://github.com/pypa/setuptools_scm#retrieving-package-version-at-runtime
This is probably the best option.
How do you reproduce the incompatibility? Is it an uncaught error? For users? Contributors?
Sorry for the noise, looks like I misread the code and it is actually compatible, because setuptools_scm adds a backwards-compatibility variable. If it were actually incompatible, there would have been an uncaught error for users.
$ cat tldextract/_version.py
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '3.3.1'
__version_tuple__ = version_tuple = (3, 3, 1)
The version handling in tldextract is no longer compatible with the default template for
_version.py
insetuptools_scm
version 7, since it changed the default template from usingversion
to__version__
in this commit:https://github.com/pypa/setuptools_scm/commit/b45e19f9f275a31873fd5e07faabef16fd0bbec0#diff-bdefa0298003efada7c465428643cc6d9c129168afb3eb5c551b40fcc77feac1
There are two ways you could handle this:
__version__
when present orversion
otherwisewrite_to_template
parameter tosetup()
to use eitherversion
or__version__
and import that in the codePersonally I suggest the second one, since it is more future-proof.