File tree Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Expand file tree Collapse file tree 3 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 2121from labscript_utils import labscript_suite_install_dir , dedent
2222from labscript_utils .labconfig import LabConfig
2323
24- from labscript_utils .versions import get_version , NoVersionInfo
25- from pathlib import Path
26- __version__ = get_version (__name__ , import_path = Path (__file__ ).parent .parent )
27- if __version__ is NoVersionInfo :
28- __version__ = None
24+ from .__version__ import __version__
2925
3026check_version ('qtutils' , '2.0.0' , '3.0.0' )
3127check_version ('labscript' , '2.6' , '3' )
Original file line number Diff line number Diff line change 1+ import os
2+ from pathlib import Path
3+ try :
4+ import importlib .metadata as importlib_metadata
5+ except ImportError :
6+ import importlib_metadata
7+
8+ VERSION_SCHEME = {
9+ "version_scheme" : os .getenv ("SCM_VERSION_SCHEME" , "guess-next-dev" ),
10+ "local_scheme" : os .getenv ("SCM_LOCAL_SCHEME" , "node-and-date" ),
11+ }
12+
13+ root = Path (__file__ ).parent .parent
14+ if (root / '.git' ).is_dir ():
15+ from setuptools_scm import get_version
16+ __version__ = get_version (root , ** VERSION_SCHEME )
17+ else :
18+ try :
19+ __version__ = importlib_metadata .version (__package__ )
20+ except importlib_metadata .PackageNotFoundError :
21+ __version__ = None
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ packages = find:
2626python_requires = >=3.6
2727install_requires =
2828 blacs>=2.7.0
29+ importlib_metadata
2930 labscript>=2.6.0
3031 labscript_utils>=2.13.2
3132 numpy>=1.15.1
You can’t perform that action at this time.
0 commit comments