diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4f6447a..0242dc2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v5 + with: + fetch-depth: 0 # Fetch all history and tags for uv-dynamic-versioning - name: Install uv uses: astral-sh/setup-uv@v5 diff --git a/pyproject.toml b/pyproject.toml index a47829b..3d74f22 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,22 @@ [build-system] -requires = ["setuptools>=61.0"] -build-backend = "setuptools.build_meta" +requires = ["hatchling>=1.25.0", "uv-dynamic-versioning>=0.11.0"] +build-backend = "hatchling.build" [project] name = "git-worktree-cli" -version = "0.2.1" +dynamic = ["version"] description = "A lightweight Python CLI tool to simplify Git worktree management" +readme = "README.md" +license = {text = "MIT"} +authors = [{name = "cebidhem"}] +keywords = ["git", "cli", "developer-tools", "claude"] requires-python = ">=3.12" +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", +] dependencies = [ "typer>=0.9.0", ] @@ -22,7 +32,18 @@ dev = [ [project.scripts] wt = "wt.cli:app" -[tool.setuptools.packages.find] -where = ["."] -include = ["wt*"] -exclude = ["specs*"] +[project.urls] +Homepage = "https://github.com/cebidhem/git-worktree-cli" +Repository = "https://github.com/cebidhem/git-worktree-cli" +Issues = "https://github.com/cebidhem/git-worktree-cli/issues" + +[tool.hatch.build.targets.wheel] +packages = ["wt"] + +[tool.hatch.version] +source = "uv-dynamic-versioning" + +[tool.uv-dynamic-versioning] +enable = true +vcs = "git" +style = "pep440" diff --git a/uv.lock b/uv.lock index dc68cbb..77914e6 100644 --- a/uv.lock +++ b/uv.lock @@ -68,7 +68,6 @@ wheels = [ [[package]] name = "git-worktree-cli" -version = "0.1.0" source = { editable = "." } dependencies = [ { name = "typer" }, diff --git a/wt/__init__.py b/wt/__init__.py index 0aacbc9..720af51 100644 --- a/wt/__init__.py +++ b/wt/__init__.py @@ -1,3 +1,9 @@ """git-worktree-cli: A lightweight Python CLI tool to simplify Git worktree management.""" -__version__ = "0.1.0" +from importlib.metadata import PackageNotFoundError, version + +try: + __version__ = version("git-worktree-cli") +except PackageNotFoundError: + # Package not installed, running from source + __version__ = "dev"