Skip to content

Commit 639e252

Browse files
Transition from setuptools to hatchling (#410)
* Transition from setuptools to hatchling * Format black --------- Co-authored-by: pyiron-runner <[email protected]>
1 parent 8ea9195 commit 639e252

File tree

11 files changed

+54
-753
lines changed

11 files changed

+54
-753
lines changed

.ci_support/environment-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ dependencies:
1313
- tqdm =4.67.1
1414
- jupyter-book =1.0.0
1515
- python =3.12
16-
- setuptools =80.8.0
16+
- hatchling =1.27.0
17+
- hatch-vcs =0.4.0

.ci_support/environment-old.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ dependencies:
77
- jinja2 =2.11.3
88
- paramiko =2.7.1
99
- tqdm =4.66.1
10-
- setuptools =75.1.0
10+
- hatchling =1.27.0
11+
- hatch-vcs =0.4.0

.ci_support/environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ dependencies:
88
- jinja2 =3.1.6
99
- paramiko =3.5.1
1010
- tqdm =4.67.1
11-
- setuptools =80.8.0
11+
- hatchling =1.27.0
12+
- hatch-vcs =0.4.0

.github/workflows/deploy.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@ jobs:
3131
run: |
3232
cp .ci_support/environment-old.yml environment.yml
3333
python .ci_support/release.py; cat pyproject.toml
34+
git update-index --assume-unchanged pyproject.toml pysqa/_version.py
3435
- name: Build
3536
shell: bash -l {0}
36-
run: |
37-
pip install versioneer[toml]==0.29
38-
python setup.py sdist bdist_wheel
37+
run: hatchling build -t sdist -t wheel
3938
- name: Publish distribution 📦 to PyPI
4039
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/pipeline.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ jobs:
6060
environment-file: environment.yml
6161
- name: Install
6262
shell: bash -l {0}
63-
run: |
64-
pip install versioneer[toml]==0.29
65-
pip install . --no-deps --no-build-isolation
63+
run: pip install . --no-deps --no-build-isolation
6664
- name: Test
6765
shell: bash -l {0}
6866
run: >
@@ -98,7 +96,6 @@ jobs:
9896
- name: Test
9997
shell: bash -l {0}
10098
run: |
101-
pip install versioneer[toml]==0.29
10299
pip install . --no-deps --no-build-isolation
103100
python -m unittest discover tests
104101
@@ -122,7 +119,6 @@ jobs:
122119
- name: Install
123120
shell: bash -l {0}
124121
run: |
125-
pip install versioneer[toml]==0.29
126122
pip install . --no-deps --no-build-isolation
127123
mkdir config
128124
cp -r tests/config/flux config
@@ -154,7 +150,7 @@ jobs:
154150
- name: Pip check
155151
shell: bash -l {0}
156152
run: |
157-
pip install versioneer[toml]==0.29 tomlkit
153+
pip install tomlkit
158154
python .ci_support/check.py
159155
cat pyproject.toml
160156
pip install . --no-deps --no-build-isolation
@@ -202,7 +198,6 @@ jobs:
202198
- name: Test
203199
shell: bash -l {0}
204200
run: |
205-
pip install versioneer[toml]==0.29
206201
pip install . --no-deps --no-build-isolation
207202
python -m unittest discover tests
208203
@@ -223,7 +218,6 @@ jobs:
223218
- name: Test
224219
shell: bash -l {0}
225220
run: |
226-
pip install versioneer[toml]==0.29
227221
pip install . --no-deps --no-build-isolation
228222
python -m unittest discover tests
229223

.readthedocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ build:
1212
jobs:
1313
pre_build:
1414
# Generate the Sphinx configuration for this Jupyter Book so it builds.
15-
- pip install versioneer[toml]==0.29
1615
- pip install . --no-deps --no-build-isolation
1716
- "cp README.md docs"
1817
- "cp notebooks/*.ipynb docs"

binder/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ dependencies:
1111
- executorlib =0.0.2
1212
- cloudpickle =3.0.0
1313
- flux-core =0.59.0
14-
- versioneer =0.28
15-
- setuptools =80.8.0
14+
- hatchling =1.27.0
15+
- hatch-vcs =0.4.0

pyproject.toml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ requires = [
33
"jinja2==3.1.6",
44
"pandas==2.2.3",
55
"pyyaml==6.0.2",
6-
"setuptools==80.8.0",
7-
"versioneer[toml]==0.29",
6+
"hatchling==1.27.0",
7+
"hatch-vcs==0.4.0",
88
]
9-
build-backend = "setuptools.build_meta"
9+
build-backend = "hatchling.build"
1010

1111
[project]
1212
name = "pysqa"
@@ -53,12 +53,6 @@ twofactor = ["pyauthenticator==0.2.0"]
5353
[project.scripts]
5454
pysqa = "pysqa.cmd:command_line"
5555

56-
[tool.setuptools.packages.find]
57-
include = ["pysqa*"]
58-
59-
[tool.setuptools.dynamic]
60-
version = {attr = "pysqa.__version__"}
61-
6256
[tool.ruff]
6357
exclude = [".ci_support", "docs", "notebooks", "tests", "setup.py", "_version.py"]
6458

@@ -96,9 +90,24 @@ ignore = [
9690
"PLR0915",
9791
]
9892

99-
[tool.versioneer]
100-
VCS = "git"
101-
style = "pep440-pre"
102-
versionfile_source = "pysqa/_version.py"
103-
parentdir_prefix = "pysqa"
104-
tag_prefix = "pysqa-"
93+
[tool.hatch.build]
94+
include = [
95+
"pysqa"
96+
]
97+
98+
[tool.hatch.build.hooks.vcs]
99+
version-file = "pysqa/_version.py"
100+
101+
[tool.hatch.build.targets.sdist]
102+
include = [
103+
"pysqa"
104+
]
105+
106+
[tool.hatch.build.targets.wheel]
107+
packages = [
108+
"pysqa"
109+
]
110+
111+
[tool.hatch.version]
112+
source = "vcs"
113+
path = "pysqa/_version.py"

pysqa/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pysqa.queueadapter import QueueAdapter
22

3-
from ._version import get_versions
3+
from . import _version
44

55
__all__ = ["QueueAdapter"]
6-
__version__ = get_versions()["version"]
6+
__version__ = _version.__version__

0 commit comments

Comments
 (0)