File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from setuptools import setup , Extension
55import os
66import codecs
7+ from pathlib import Path
78
89
910if os .getenv ('XXHASH_LINK_SO' ):
@@ -30,6 +31,10 @@ def readfile(filename):
3031
3132long_description = readfile ('README.rst' ) + '\n ' + readfile ('CHANGELOG.rst' )
3233
34+ version_dict = {}
35+ exec (Path (__file__ ).parent .joinpath ("xxhash" , "version.py" ).read_text (), {}, version_dict )
36+ version = version_dict ["VERSION" ]
37+
3338setup_kwargs = {}
3439if os .getenv ("CI" ):
3540 # for compatibility, see https://pypi.org/project/setuptools-scm/7.1.0/#setup-py-usage-deprecated
@@ -39,6 +44,8 @@ def readfile(filename):
3944 "write_to_template" : "VERSION = \" {version}\" \n VERSION_TUPLE = {version_tuple}\n " ,
4045 }
4146 setup_kwargs ["setup_requires" ] = ["setuptools_scm" ]
47+ else :
48+ setup_kwargs ["version" ] = version
4249
4350setup (
4451 name = 'xxhash' ,
You can’t perform that action at this time.
0 commit comments