From bc4908274ea023ed4b4da5e68527020a31aac849 Mon Sep 17 00:00:00 2001 From: cookiecutter-e3 Date: Wed, 11 Dec 2024 10:45:41 +0000 Subject: [PATCH] New versioning system for e3 packages The number of commits since the last tagged version will be appended to the version of the package as the patch version by build_wheel.py instead of the date. The minor version of each package will be bumped in their respective MRs to avoid conflicts with the old versioning system. Ref it/org/operation_support/iaas/issues#214 See merge request it/cookiecutter-e3!60 of the template --- build_wheel.py | 6 ++++-- tox.ini | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/build_wheel.py b/build_wheel.py index 0898cac..0ec63ec 100644 --- a/build_wheel.py +++ b/build_wheel.py @@ -30,7 +30,7 @@ def run(cmd: list[str], fail_ok: bool | None = None) -> Run: :return: the Run instance """ logger.info(f"$ {' '.join(cmd)}") - p = Run(cmd, cwd=ROOT_DIR) + p = Run(cmd, cwd=str(ROOT_DIR)) if p.status != 0 and not fail_ok: logger.error(p.out) sys.exit(1) @@ -91,7 +91,9 @@ def main() -> None: run(["git", "fetch", "--unshallow", "--tags"], fail_ok=True) # Describe the most recent tag p = run(["git", "describe", "--tags"]) - last_tag = p.out.strip() + output = p.out + assert output is not None + last_tag = output.strip() # Format is v..(-)? with commits omitted if # the current commit is also the one tagged diff --git a/tox.ini b/tox.ini index 84ae324..3f9157b 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,14 @@ deps = codecov: codecov extras = test +# Speed up coverage on Python >= 3.12 +setenv = + # Set COVERAGE_CORE only for Python >= 3.12 + COVERAGE_CORE=sysmon + py311: COVERAGE_CORE= + py310: COVERAGE_CORE= + py39: COVERAGE_CORE= + # Run testsuite with coverage when '-cov' and with multi-threading when '-xdist' # is in the env name commands=