diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index b1c695e..80ea8dd 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -24,13 +24,12 @@ jobs: - name: Install hatch run: | pip install hatch - hatch env create - name: Check that versions match id: version run: | echo "Release tag: [${{ github.ref_name }}]" - PACKAGE_VERSION=$(hatch run python -c "import rpzip; print(rpzip.__version__)") + PACKAGE_VERSION=$(hatch version) echo "Package version: [$PACKAGE_VERSION]" [ "${{ github.ref_name }}" == "cli-v$PACKAGE_VERSION" ] || { exit 1; } echo "major_minor_version=v${PACKAGE_VERSION%.*}" >> $GITHUB_OUTPUT diff --git a/.github/workflows/release-lib.yml b/.github/workflows/release-lib.yml index bf7e7a2..19bb92e 100644 --- a/.github/workflows/release-lib.yml +++ b/.github/workflows/release-lib.yml @@ -27,7 +27,7 @@ jobs: id: version run: | echo "Release tag: [${{ github.ref_name }}]" - PACKAGE_VERSION=$(hatch run python -c "import repro_zipfile; print(repro_zipfile.__version__)") + PACKAGE_VERSION=$(hatch version) echo "Package version: [$PACKAGE_VERSION]" [ "${{ github.ref_name }}" == "v$PACKAGE_VERSION" ] || { exit 1; } echo "major_minor_version=v${PACKAGE_VERSION%.*}" >> $GITHUB_OUTPUT diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index f1919b1..06b0d35 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog — rpzip +## v0.1.1 (2024-02-01) + +- Fixed misformatted `--version` output. + ## v0.1.0 (2024-01-27) Initial release! 🎉 diff --git a/cli/pyproject.toml b/cli/pyproject.toml index 9fbaefb..7ebfe34 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "A lightweight command-line program for creating reproducible/deterministic ZIP archives." readme = "README.md" requires-python = ">=3.8" -license = "MIT" +license = { text = "MIT License" } keywords = ["zipfile", "zip", "reproducible", "deterministic", "cli"] authors = [{ name = "DrivenData", email = "info@drivendata.org" }] classifiers = [ diff --git a/cli/rpzip.py b/cli/rpzip.py index 1bd3948..cb64b5c 100644 --- a/cli/rpzip.py +++ b/cli/rpzip.py @@ -3,9 +3,9 @@ import sys from typing import List, Optional -try: +if sys.version_info >= (3, 9): from typing import Annotated -except ImportError: +else: from typing_extensions import Annotated import typer @@ -25,7 +25,7 @@ def version_callback(value: bool): if value: print(f"repro-zipfile v{repro_zipfile_version}") - print(f"rpzip (rpzip) v{__version__}") + print(f"rpzip v{__version__}") raise typer.Exit() diff --git a/pyproject.toml b/pyproject.toml index b49ec65..116cb44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ dynamic = ["version"] description = "A tiny, zero-dependency replacement for Python's zipfile.ZipFile for creating reproducible/deterministic ZIP archives." readme = "README.md" requires-python = ">=3.8" -license = "MIT" +license = { file = "LICENSE" } keywords = ["zipfile", "zip", "reproducible", "deterministic"] authors = [{ name = "DrivenData", email = "info@drivendata.org" }] classifiers = [ @@ -44,22 +44,22 @@ path = "repro_zipfile.py" [tool.hatch.envs.default] pre-install-commands = [ - "pip install -e cli", + "pip install -e . -e cli", ] features = ["cli", "tests"] -dependencies = ["mypy>=1.0.0", "ruff>=0.1.14"] +dependencies = ["ipython", "mypy>=1.0.0", "ruff>=0.1.14"] python = "3.10" path = ".venv" [tool.hatch.envs.default.scripts] lint = ["ruff format --check {args:.}", "ruff check {args:.}"] -typecheck = ["mypy {args:repro_zipfile.py} --install-types --non-interactive"] +typecheck = ["mypy {args:repro_zipfile.py cli/rpzip.py} --install-types --non-interactive"] ## TESTS ENVIRONMENT ## [tool.hatch.envs.tests] pre-install-commands = [ - "pip install -e cli", + "pip install -e . -e cli", ] features = ["tests", "cli"] dependencies = ["coverage>=6.5", "pytest-cov"]