mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 06:29:21 +01:00
dev: version from file to cmake and python (#1025)
- renamed conda-recipe folder - added a check to see if build and install folder exists in build.sh (conda recipe) - created VERSION file that has '0.0.0'for developer but can be updated using update_version.py that takes in a version. The script checks for semantic versioning and updates VERSION file - VERSION file also copied along with py files to slsdet in python cmakelist and build_pylib.sh (for conda), also copied in root folder for installations (for no coding purpose) - init.py and setup.py reads this file to get the version (a bit differently to find the VERSION file) - VERSION file read into cmake to get the version and also added to compile definition. So RELEASE removed from versionAPI.h (using SLS_DET_VERSION compile definiton instead) and also removed updateRelease script. - conda getting project version from environment variable SLS_DET_VERSION that is set in build_pylib.sh prior. - added 3.13 python to conda build - anything related to ctb removed from release notes as users will always use developer - sets 0.0.0 to VERSION file by running update_version.py without an argument
This commit is contained in:
@@ -22,6 +22,7 @@ defs = _slsdet.slsDetectorDefs
|
||||
from .enums import *
|
||||
from .defines import *
|
||||
|
||||
|
||||
IpAddr = _slsdet.IpAddr
|
||||
MacAddr = _slsdet.MacAddr
|
||||
scanParameters = _slsdet.scanParameters
|
||||
@@ -29,12 +30,14 @@ currentSrcParameters = _slsdet.currentSrcParameters
|
||||
DurationWrapper = _slsdet.DurationWrapper
|
||||
pedestalParameters = _slsdet.pedestalParameters
|
||||
|
||||
|
||||
import subprocess
|
||||
def get_git_tag():
|
||||
import os
|
||||
def read_version():
|
||||
try:
|
||||
return subprocess.check_output(['git', 'describe', '--tags', '--abbrev=0']).strip().decode('utf-8')
|
||||
except subprocess.CalledProcessError:
|
||||
return 'developer'
|
||||
__version__ = get_git_tag()
|
||||
version_file = os.path.join(os.path.dirname(__file__), 'VERSION')
|
||||
with open(version_file, "r") as f:
|
||||
return f.read().strip()
|
||||
except:
|
||||
raise RuntimeError("VERSION file not found in slsdet package from init.py")
|
||||
|
||||
__version__ = read_version()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user