Skip to content

Commit

Permalink
setup: Support passing version through the environment
Browse files Browse the repository at this point in the history
By setting FRIDA_VERSION. But only when not in a source package.

This is needed so that our CI can use the same version across our repos,
for non-release builds. For release builds we tag each repo, which means
we don't have to worry about this.
  • Loading branch information
oleavr committed May 9, 2024
1 parent 25270d4 commit 1086ae6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,20 @@ def detect_version() -> str:
version_line = [
line for line in pkg_info.read_text(encoding="utf-8").split("\n") if line.startswith("Version: ")
][0].strip()
version = version_line[9:]
else:
releng_location = next(enumerate_releng_locations(), None)
if releng_location is not None:
sys.path.insert(0, str(releng_location.parent))
from releng.frida_version import detect

version = detect(SOURCE_ROOT).name.replace("-dev.", ".dev")
else:
version = "0.0.0"
return version
return version_line[9:]

version = os.environ.get("FRIDA_VERSION")
if version is not None:
return version

releng_location = next(enumerate_releng_locations(), None)
if releng_location is not None:
sys.path.insert(0, str(releng_location.parent))
from releng.frida_version import detect

return detect(SOURCE_ROOT).name.replace("-dev.", ".dev")

return "0.0.0"


def compute_long_description() -> str:
Expand Down

0 comments on commit 1086ae6

Please sign in to comment.