diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 40de625eeb94..83e0d28e07a6 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -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 diff --git a/ci/release/bump_version.py b/ci/release/bump_version.py new file mode 100644 index 000000000000..8c0db942bce1 --- /dev/null +++ b/ci/release/bump_version.py @@ -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() diff --git a/justfile b/justfile index 7c64a8bdd817..ec96e8bdd980 100644 --- a/justfile +++ b/justfile @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 3072c3ffdb55..1ba40c73251e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/uv.lock b/uv.lock index c5c4cbac0802..6280d3dd2dbf 100644 --- a/uv.lock +++ b/uv.lock @@ -1214,6 +1214,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c8/2f/b81d855287b8bb44da1454a0d6e154dcd0e40f1c3654d120002cbde31479/duckdb-1.1.2-cp313-cp313-win_amd64.whl", hash = "sha256:e3e6300b7ccaf64b609f4f0780a6e1d25ab8cf34cceed46e62c35b6c4c5cb63b", size = 10953563 }, ] +[[package]] +name = "dunamai" +version = "1.22.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a0/fe/aee602f08765de4dd753d2e5d6cbd480857182e345f161f7a19ad1979e4d/dunamai-1.22.0.tar.gz", hash = "sha256:375a0b21309336f0d8b6bbaea3e038c36f462318c68795166e31f9873fdad676", size = 44453 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b8/01/0c3ba3dcf946e884ad8a153f6ac277e38cc8e87038059dbb751f89b9e258/dunamai-1.22.0-py3-none-any.whl", hash = "sha256:eab3894b31e145bd028a74b13491c57db01986a7510482c9b5fff3b4e53d77b7", size = 26187 }, +] + [[package]] name = "et-xmlfile" version = "2.0.0" @@ -1986,6 +1998,7 @@ visualization = [ [package.dev-dependencies] dev = [ { name = "codespell", extra = ["hard-encoding-detection", "toml"] }, + { name = "dunamai" }, { name = "google-cloud-storage" }, { name = "ipython" }, { name = "pre-commit" }, @@ -2178,6 +2191,7 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ { name = "codespell", extras = ["hard-encoding-detection", "toml"], specifier = ">=2.2.6,<3" }, + { name = "dunamai", specifier = ">=1.22.0" }, { name = "google-cloud-storage", specifier = ">=2.7.0,<3" }, { name = "ipython", specifier = ">=8.7.0,<9" }, { name = "pre-commit", specifier = ">=4,<5" },