File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929DOWNLOAD_URL = URL + "/tarball/" + get_version ()
3030
3131
32- # (3) Call setup() with as little args as possible
33- setup (
34- download_url = DOWNLOAD_URL ,
35- use_scm_version = {
36- "write_to" : "src/makefun/_version.py" ,
37- # Custom template to avoid type hints and annotations (python <3.8)
38- "version_file_template" : """# file generated by setuptools_scm
32+ # Setuptools_scm target version file to generate
33+ args = {
34+ "write_to" : "src/makefun/_version.py" ,
35+ }
36+ # Use the 'version_file_template' directive if possible to avoid type hints and annotations (python <3.8)
37+ from packaging .version import Version
38+ setuptools_scm_version = pkg_resources .get_distribution ("setuptools_scm" ).version
39+ if Version (setuptools_scm_version ) >= Version ('8.1.0' ):
40+ # Note that it was named 'write_to_template' earlier. But at that time it was not generating annotations so no need.
41+ args ["version_file_template" ] = """# file generated by setuptools_scm
3942# don't change, don't track in version control
4043__version__ = version = '{version}'
4144__version_tuple__ = version_tuple = {version_tuple}
4245"""
43- }, # we can't put `use_scm_version` in setup.cfg yet unfortunately
46+ # (3) Call setup() with as little args as possible
47+ setup (
48+ download_url = DOWNLOAD_URL ,
49+ use_scm_version = args
4450)
You can’t perform that action at this time.
0 commit comments