Skip to content

Commit

Permalink
Migrate versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
oerc0122 committed Nov 5, 2024
1 parent 76f90e1 commit 659e1c2
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 713 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
shell: bash -l {0}
env:
EUPHONIC_VERSION: ${{ github.event.inputs.version }}
run: python -m tox -c release_tox.ini
run: python -m tox -c build_utils/release_tox.ini
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
Expand All @@ -54,4 +54,3 @@ jobs:
uses: EnricoMi/publish-unit-test-result-action@v2
with:
junit_files: artifacts/**/junit_report*.xml

File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions build_utils/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from pathlib import Path

Check notice on line 1 in build_utils/version.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

build_utils/version.py#L1

Missing module docstring
import subprocess
import sys

gits = ["git"]
if sys.platform == "win32":
gits += ["git.cmd", "git.exe"]

for gitcmd in gits:
try:
proc = subprocess.run([gitcmd, "describe", "--tags", "--dirty"], capture_output=True, check=True, text=True)

Check notice on line 11 in build_utils/version.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

build_utils/version.py#L11

Line too long (116/100)
version, *dirty = proc.stdout.strip().split("-")
if dirty:
version += f"+{dirty[0]}.{dirty[1]}{'.dirty' if len(dirty) > 2 else ''}"
break

except (OSError, subprocess.CalledProcessError):
continue
else: # Can't use git
version_file = Path(__file__).parent.parent / "euphonic" / "version.py"
version = version_file.read_text().split("=")[1].strip('"\n ')


print(version)
1 change: 1 addition & 0 deletions build_utils/version.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "@VERSION@"
2 changes: 1 addition & 1 deletion euphonic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from importlib.resources import files

from . import data
__version__ = '1.3.3a'
from .version import __version__

import pint
from pint import UnitRegistry
Expand Down
Loading

0 comments on commit 659e1c2

Please sign in to comment.