Skip to content

Commit 12fb21e

Browse files
authored
Merge pull request #761 from pyiron/hatchling
Use hatchling as build system
2 parents 73ff3e3 + 72f898b commit 12fb21e

11 files changed

Lines changed: 53 additions & 763 deletions

File tree

.binder/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ dependencies:
66
- cloudpickle =3.1.1
77
- executorlib =1.7.1
88
- graphviz =9.0.0
9+
- hatchling =1.27.0
10+
- hatch-vcs =0.5.0
911
- pandas =2.3.2
1012
- pint =0.25
1113
- pyiron_snippets =0.2.0
1214
- python >=3.11,<3.14
1315
- python-graphviz =0.21
1416
- rdflib =7.1.4
1517
- semantikon =0.0.22
16-
- setuptools>=68
1718
- toposort =1.10
1819
- typeguard =4.4.4
19-
- wheel

.ci_support/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ dependencies:
66
- cloudpickle =3.1.1
77
- executorlib =1.7.1
88
- graphviz =9.0.0
9+
- hatchling =1.27.0
10+
- hatch-vcs =0.5.0
911
- pandas =2.3.2
1012
- pint =0.25
1113
- pyiron_snippets =0.2.0
1214
- python >=3.11,<3.14
1315
- python-graphviz =0.21
1416
- rdflib =7.1.4
1517
- semantikon =0.0.22
16-
- setuptools>=68
1718
- toposort =1.10
1819
- typeguard =4.4.4
19-
- wheel

.ci_support/lower_bound.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ dependencies:
88
- cloudpickle =3.0.0
99
- executorlib =1.5.3
1010
- graphviz =9.0.0
11+
- hatchling =1.27.0
12+
- hatch-vcs =0.5.0
1113
- pandas =2.2.2
1214
- pint =0.24
1315
- python =3.11

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
name: Release
33

44
on:
5-
# pull_request:
5+
pull_request:
66
release:
77
types: [ published ]
88

99
jobs:
1010
pyiron:
11-
uses: pyiron/actions/.github/workflows/pyproject-release.yml@actions-4.0.8
11+
uses: pyiron/actions/.github/workflows/hatch-release.yml@actions-4.0.8
1212
secrets: inherit
1313
with:
1414
semantic-upper-bound: 'minor'
1515
lower-bound-yaml: '.ci_support/lower_bound.yml'
16-
# publish-to-pypi: false
16+
publish-to-pypi: ${{ github.event_name == 'release' && github.event.action == 'published' }}

.readthedocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ build:
1111
python: "mambaforge-22.9"
1212
jobs:
1313
pre_build:
14-
- pip install versioneer[toml]==0.29
1514
- pip install . --no-deps --no-build-isolation
1615

1716
# Build documentation in the docs/ directory with Sphinx

docs/conf.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import subprocess
1919
from sphinx.ext.apidoc import main
2020

21+
import pyiron_workflow
22+
2123
# If extensions (or modules to document with autodoc) are in another directory,
2224
# add these directories to sys.path here. If the directory is relative to the
2325
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -48,6 +50,10 @@
4850
# Add any paths that contain templates here, relative to this directory.
4951
templates_path = ['_templates']
5052

53+
nbsphinx_thumbnails = {
54+
'source/notebooks/example': "_static/pyiron-logo-dark.png",
55+
}
56+
5157
# The suffix of source filenames.
5258
source_suffix = {
5359
'.rst': 'restructuredtext',
@@ -62,22 +68,16 @@
6268

6369
# General information about the project.
6470
project = u'pyiron_workflow'
65-
copyright = u'2021, Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department ' \
71+
copyright = u'2024, Max-Planck-Institut für Nachhaltige Materialien GmbH - Computational Materials Design (CM) Department ' \
6672
u'All rights reserved'
6773

6874
# The version info for the project you're documenting, acts as replacement for
6975
# |version| and |release|, also used in various other places throughout the
7076
# built documents.
7177
#
7278
# The short X.Y version.
73-
version_full = subprocess.check_output(
74-
"python -c 'import versioneer; print(versioneer.get_version())'",
75-
cwd=os.path.join(os.path.curdir, '..'),
76-
universal_newlines=True,
77-
shell=True
78-
)
79-
version_full = version_full.split('\n')[0]
80-
version = '.'.join(version_full.split('.')[0:2])
79+
version_full = pyiron_workflow.__version__
80+
version = '.'.join(version_full.split('.')[:2])
8181
# The full version, including alpha/beta/rc tags.
8282
release = version_full
8383

@@ -240,7 +240,7 @@
240240
# author, documentclass [howto, manual, or own class]).
241241
latex_documents = [
242242
('index', 'pyiron_workflow.tex', u'pyiron_workflow Documentation',
243-
u'Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department', 'manual'),
243+
u'Max-Planck-Institut für Nachhaltige Materialien GmbH - Computational Materials Design (CM) Department', 'manual'),
244244
]
245245

246246
# The name of an image file (relative to this directory) to place at the top of
@@ -272,7 +272,7 @@
272272
('index',
273273
'pyiron_workflow',
274274
u'pyiron_workflow Documentation',
275-
[u'Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department'], 1)
275+
[u'Max-Planck-Institut für Nachhaltige Materialien GmbH - Computational Materials Design (CM) Department'], 1)
276276
]
277277

278278
# If true, show URL addresses after external links.
@@ -288,7 +288,7 @@
288288
('index',
289289
'pyiron_workflow',
290290
u'pyiron_workflow Documentation',
291-
u'Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department',
291+
u'Max-Planck-Institut für Nachhaltige Materialien GmbH - Computational Materials Design (CM) Department',
292292
'pyiron_workflow',
293293
'Graph-based workflow management.',
294294
'Miscellaneous'),

docs/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ dependencies:
1212
- cloudpickle =3.1.1
1313
- executorlib =1.7.1
1414
- graphviz =9.0.0
15+
- hatchling =1.27.0
16+
- hatch-vcs =0.5.0
1517
- pandas =2.3.2
1618
- pint =0.25
1719
- pyiron_snippets =0.2.0
1820
- python >=3.11,<3.14
1921
- python-graphviz =0.21
2022
- rdflib =7.1.4
2123
- semantikon =0.0.22
22-
- setuptools>=68
2324
- toposort =1.10
2425
- typeguard =4.4.4
25-
- wheel

pyiron_workflow/__init__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@
2222
guided workflow design
2323
"""
2424

25-
from ._version import get_versions
25+
import importlib.metadata
2626

27-
__version__ = get_versions()["version"]
27+
try:
28+
# Installed package will find its version
29+
__version__ = importlib.metadata.version(__name__)
30+
except importlib.metadata.PackageNotFoundError:
31+
# Repository clones will register an unknown version
32+
__version__ = "0.0.0+unknown"
2833

2934
# User API
3035

0 commit comments

Comments
 (0)