Skip to content

Commit 40b788d

Browse files
jan-janssenpyiron-runnerpre-commit-ci[bot]
authored
Switch from versioneer to hatchling (#379)
* Switch from versioneer to hatchling * Format black * Update environment.yml * Delete pyiron.log * Update pyproject.toml * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Delete setup.py --------- Co-authored-by: pyiron-runner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e42a9c2 commit 40b788d

File tree

9 files changed

+49
-746
lines changed

9 files changed

+49
-746
lines changed

.ci_support/environment-old.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ dependencies:
1515
- scipy =1.9.3
1616
- spglib =1.16.5
1717
- sqsgenerator =0.2
18+
- hatchling =1.27.0
19+
- hatch-vcs =0.4.0

.ci_support/environment.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ dependencies:
1919
- scipy =1.15.2
2020
- spglib =2.6.0
2121
- sqsgenerator =0.3
22+
- hatchling =1.27.0
23+
- hatch-vcs =0.4.0

.ci_support/environment_mini.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ dependencies:
55
- coverage
66
- numpy =1.26.4
77
- scipy =1.15.2
8-
- setuptools
8+
- hatchling =1.27.0
9+
- hatch-vcs =0.4.0

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: |
3333
cp .ci_support/environment-old.yml environment.yml
3434
python .ci_support/release.py; cat pyproject.toml
35-
pip install versioneer[toml]==0.29
36-
python setup.py sdist bdist_wheel
35+
git update-index --assume-unchanged pyproject.toml structuretoolkit/_version.py
36+
hatchling build -t sdist -t wheel
3737
- name: Publish distribution 📦 to PyPI
3838
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/pipeline.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ jobs:
5757
environment-file: .ci_support/environment_mini.yml
5858
- name: Test
5959
shell: bash -l {0}
60-
timeout-minutes: 30
60+
timeout-minutes: 5
6161
run: |
62-
pip install versioneer[toml]==0.29
6362
pip install . --no-deps --no-build-isolation
6463
python -m unittest discover tests
6564
@@ -80,7 +79,7 @@ jobs:
8079
- name: Pip check
8180
shell: bash -l {0}
8281
run: |
83-
pip install versioneer[toml]==0.29 tomlkit
82+
pip install tomlkit
8483
python .ci_support/check.py
8584
cat pyproject.toml
8685
pip install . --no-deps --no-build-isolation
@@ -129,9 +128,8 @@ jobs:
129128
environment-file: .ci_support/environment.yml
130129
- name: Test
131130
shell: bash -l {0}
132-
timeout-minutes: 30
131+
timeout-minutes: 5
133132
run: |
134-
pip install versioneer[toml]==0.29
135133
pip install . --no-deps --no-build-isolation
136134
coverage run
137135
coverage xml
@@ -157,9 +155,8 @@ jobs:
157155
environment-file: .ci_support/environment-old.yml
158156
- name: Test
159157
shell: bash -l {0}
160-
timeout-minutes: 30
158+
timeout-minutes: 5
161159
run: |
162-
pip install versioneer[toml]==0.29
163160
pip install . --no-deps --no-build-isolation
164161
python -m unittest discover tests
165162

pyproject.toml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
2-
requires = ["ase", "numpy", "setuptools", "scipy", "versioneer[toml]==0.29"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["ase", "numpy", "scipy", "hatchling==1.27.0", "hatch-vcs==0.5.0"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "structuretoolkit"
@@ -57,12 +57,6 @@ phonopy = [
5757
]
5858
pyxtal = ["pyxtal==1.1.0"]
5959

60-
[tool.setuptools.packages.find]
61-
include = ["structuretoolkit*"]
62-
63-
[tool.setuptools.dynamic]
64-
version = {attr = "structuretoolkit.__version__"}
65-
6660
[tool.ruff]
6761
exclude = [".ci_support", "tests", "setup.py", "_version.py"]
6862

@@ -112,13 +106,23 @@ ignore = [
112106
"PLR0915",
113107
]
114108

115-
[tool.versioneer]
116-
VCS = "git"
117-
style = "pep440-pre"
118-
versionfile_source = "structuretoolkit/_version.py"
119-
parentdir_prefix = "structuretoolkit"
120-
tag_prefix = "structuretoolkit-"
109+
[tool.hatch.build.hooks.vcs]
110+
version-file = "structuretoolkit/_version.py"
111+
112+
[tool.hatch.build.targets.sdist]
113+
include = [
114+
"structuretoolkit"
115+
]
116+
117+
[tool.hatch.build.targets.wheel]
118+
packages = [
119+
"structuretoolkit"
120+
]
121+
122+
[tool.hatch.version]
123+
source = "vcs"
124+
path = "structuretoolkit/_version.py"
121125

122126
[tool.coverage.run]
123127
omit = ["structuretoolkit/_version.py", "tests/*"]
124-
command_line = "-m unittest discover tests"
128+
command_line = "-m unittest discover tests"

setup.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

structuretoolkit/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Analyse
2+
import structuretoolkit._version
23
from structuretoolkit.analyse import (
34
find_mic,
45
find_solids,
@@ -96,8 +97,6 @@
9697
# Visualize
9798
from structuretoolkit.visualize import plot3d
9899

99-
from . import _version
100-
101100
__all__ = [
102101
"find_mic",
103102
"find_solids",
@@ -156,4 +155,5 @@
156155
"select_index",
157156
"plot3d",
158157
]
159-
__version__ = _version.get_versions()["version"]
158+
159+
__version__ = structuretoolkit._version.__version__

0 commit comments

Comments
 (0)