Skip to content

Commit

Permalink
chore: clean up pre-release versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Nov 4, 2024
1 parent 36ae765 commit e2577b5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
set -euo pipefail
VERSION="$(uvx dunamai from git --style pep440 --no-metadata --latest-tag --pattern default-unprefixed)"
VERSION="$(uv run --only-group dev python ci/release/bump_version.py)"
echo "value=${VERSION}" >> "$GITHUB_OUTPUT"
- name: build wheel and source dist
Expand Down
17 changes: 17 additions & 0 deletions ci/release/bump_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from __future__ import annotations


def main():
from dunamai import Version

version = Version.from_git(latest_tag=True, pattern="default-unprefixed")
if version.distance:
version = version.bump(index=0)
out = f"{version.base}.dev{version.distance}"
else:
out = version.serialize()
print(out) # noqa: T201


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ build-jupyterlite:

rm -rf dist/

ibis_dev_version="$(uvx dunamai from git --style pep440 --no-metadata --latest-tag --pattern default-unprefixed)"
ibis_dev_version="$(uv run --only-group dev python ci/release/bump_version.py)"
uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version "$ibis_dev_version"
sed -i "s/__version__ = \".+\"/__version__ = \"$ibis_dev_version\"/" ibis/__init__.py
uv build --wheel
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ dev = [
"pyinstrument>=4.5.1,<6",
"ruff>=0.1.8",
"tqdm>=4.66.1,<5",
"dunamai>=1.22.0",
]
tests = [
"cloudpickle",
Expand Down
14 changes: 14 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e2577b5

Please sign in to comment.