Skip to content

Commit 4d65b0c

Browse files
committed
Only enable setuptools_scm in github actions
1 parent ede28e5 commit 4d65b0c

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
2+
requires = ["setuptools>=45", "wheel"]
33

44
[tool.setuptools_scm]
55
write_to = "xxhash/version.py"

setup.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ def readfile(filename):
3030

3131
long_description = readfile('README.rst') + '\n' + readfile('CHANGELOG.rst')
3232

33+
setup_kwargs = {}
34+
if os.getenv("CI"):
35+
# for compatibility, see https://pypi.org/project/setuptools-scm/7.1.0/#setup-py-usage-deprecated
36+
setup_kwargs["use_scm_version"] = {
37+
"write_to": "xxhash/version.py",
38+
"local_scheme": "no-local-version",
39+
"write_to_template": "VERSION = \"{version}\"\nVERSION_TUPLE = {version_tuple}\n",
40+
}
41+
setup_kwargs["setup_requires"] = ["setuptools_scm"]
42+
3343
setup(
3444
name='xxhash',
3545
description="Python binding for xxHash",
@@ -58,11 +68,5 @@ def readfile(filename):
5868
python_requires=">=3.7",
5969
ext_modules=ext_modules,
6070
package_data={"xxhash": ["py.typed", "**.pyi"]},
61-
# for compatibility, see https://pypi.org/project/setuptools-scm/7.1.0/#setup-py-usage-deprecated
62-
use_scm_version={
63-
"write_to": "xxhash/version.py",
64-
"local_scheme": "no-local-version",
65-
"write_to_template": "VERSION = \"{version}\"\nVERSION_TUPLE = {version_tuple}\n",
66-
},
67-
setup_requires=["setuptools_scm"],
71+
**setup_kwargs,
6872
)

xxhash/version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VERSION = "3.3.1"
2+
VERSION_TUPLE = (3, 3, 1)

0 commit comments

Comments
 (0)