1515# Configure setuptools_scm to build a custom version (for more info,
1616# see https://stackoverflow.com/a/78657279 and https://setuptools-scm.readthedocs.io/en/latest/extending)
1717# If on a clean release, it uses no local scheme
18- # Otherwise, it uses g{commit hash}.{branch}.[clean | d{date}] for the local scheme,
19- # where the last entry is "clean " if everything is committed and otherwise the date of last commit
18+ # Otherwise, it uses g{commit hash}.{branch}.[CLEAN | d{date}] for the local scheme,
19+ # where the last entry is "CLEAN " if everything is committed and otherwise the date of last commit
2020def custom_version (version ):
2121 from setuptools_scm .version import get_local_node_and_date
2222
23- b = version .branch if version .branch and version .branch != "master" else None
24-
2523 local_scheme = ""
2624 if version .dirty or version .distance :
2725 node_and_date = get_local_node_and_date (version )
@@ -30,11 +28,9 @@ def custom_version(version):
3028 node , date = node_and_date .split ('.' )
3129 else :
3230 node = node_and_date
33- date = "clean "
31+ date = "CLEAN "
3432
35- local_scheme = node + (f'.{ b } .' if b else 'master' ) + date
36- elif b :
37- local_scheme = f"+{ b } "
33+ local_scheme = node + f'.{ version .branch } .' + date
3834
3935 return local_scheme
4036
@@ -65,7 +61,7 @@ def setup_with_extensions(extensions=None):
6561 use_scm_version = {'version_scheme' : 'no-guess-dev' , 'version_file' : "pygsti/_version.py" , 'local_scheme' : custom_version },
6662 cmdclass = {'build_ext' : build_ext_compiler_check },
6763 ext_modules = extensions or [],
68- packages = find_packages (),
64+ packages = find_packages (where = '.' , include = [ 'pygsti' ] ),
6965 package_data = {
7066 'pygsti.tools' : ['fastcalc.pyx' ],
7167 'pygsti.evotypes' : [
0 commit comments