Skip to content

Commit 78f0acf

Browse files
Migrate to hatchling build backend
1 parent e2dcef7 commit 78f0acf

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

.github/workflows/pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ jobs:
2525
python-version: "3.x"
2626

2727
- name: Install build backend
28-
run: python -m pip install --upgrade pip build setuptools_scm
28+
run: python -m pip install --upgrade pip hatchling hatch-vcs
2929

3030
- name: Build wheel and sdist
31-
run: python -m build . --outdir dist/
31+
run: python -m pip install hatch && hatch build --outdir dist/
3232

3333
- name: Store the distribution packages
3434
uses: actions/upload-artifact@v4

pyproject.toml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["setuptools>=80", "setuptools-scm>=8"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling", "hatch-vcs"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "agentlab"
@@ -70,18 +70,15 @@ dev = [
7070
[project.urls]
7171
Homepage = "https://github.com/ServiceNow/AgentLab"
7272

73-
# src/ layout discovery
74-
[tool.setuptools]
75-
package-dir = {"" = "src"}
76-
77-
[tool.setuptools.packages.find]
78-
where = ["src"]
79-
80-
[tool.setuptools_scm]
81-
write_to = "src/agentlab/_version.py"
73+
[tool.hatch.version]
74+
source = "vcs" # use version from git tags
75+
fallback-version = "0.0.0"
76+
[tool.hatch.build.targets.wheel]
77+
packages = ["src/agentlab"]
78+
[tool.hatch.build.hooks.vcs]
79+
version-file = "src/agentlab/_version.py"
80+
[tool.hatch.version.raw-options]
8281
version_scheme = "guess-next-dev"
83-
local_scheme = "no-local-version"
84-
fallback_version = "0.0.0"
8582

8683
[tool.black]
8784
line-length = 100

0 commit comments

Comments
 (0)