-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
20 changed files
with
105 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,4 +211,4 @@ This document describes the differences between vx.x.x and vx.0.2 | |
------- | ||
|
||
[email protected] | ||
[email protected] | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# SPDX-License-Identifier: LGPL-3.0-or-other | ||
# Copyright (C) 2021 Contributors to the SLS Detector Package | ||
|
||
echo "|<-------- starting python build" | ||
|
||
cd python | ||
|
||
# copy VERSION into slsdet for installation | ||
cp ../VERSION slsdet/VERSION | ||
|
||
# to be used to get project version in meta.yaml | ||
export SLS_DET_VERSION=$(cat python/slsdet/VERSION) | ||
|
||
${PYTHON} setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ python: | |
- 3.10 | ||
- 3.11 | ||
- 3.12 | ||
|
||
- 3.13 | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SPDX-License-Identifier: LGPL-3.0-or-other | ||
# Copyright (C) 2021 Contributors to the SLS Detector Package | ||
""" | ||
Script to update VERSION file with semantic versioning if provided as an argument, or with 0.0.0 if no argument is provided. | ||
""" | ||
|
||
import sys | ||
import re | ||
|
||
def get_version(): | ||
|
||
# Check at least one argument is passed | ||
if len(sys.argv) < 2: | ||
return "0.0.0" | ||
|
||
version = sys.argv[1] | ||
|
||
# Validate that the version argument matches semantic versioning format (X.Y.Z) | ||
if not re.match(r'^\d+\.\d+\.\d+$', version): | ||
print("Error: Version argument must be in semantic versioning format (X.Y.Z)") | ||
sys.exit(1) | ||
|
||
return version | ||
|
||
|
||
def write_version_to_file(version): | ||
with open("VERSION", "w") as version_file: | ||
version_file.write(version) | ||
print(f"Version {version} written to VERSION file.") | ||
|
||
|
||
# Main script | ||
if __name__ == "__main__": | ||
|
||
version = get_version() | ||
write_version_to_file(version) |