Skip to content

Commit e19d5b3

Browse files
authored
switch away from setup.py to pyproject.toml (#195)
this is consistent with PEP 517 and 621
1 parent e75ab52 commit e19d5b3

File tree

6 files changed

+65
-52
lines changed

6 files changed

+65
-52
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ https://python-hydro.github.io/pyro2
6565
Alternately, you can install directly from source, via
6666
6767
```
68-
python setup.py install --user
68+
pip install .
6969
```
7070
71-
or you can use `develop` instead of `install` if you are
71+
you can optionally add the `-e` argument to `install` if you are
7272
planning on developing pyro solvers directly.
7373
7474
- Not all matplotlib backends allow for the interactive plotting as

docs/source/design.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pyro follows a standard python package structure. The main directory
3333

3434
* ``www/`` : the logo used in the website
3535

36-
It is at this level (``pyro2/``) that the installation of pyro is done (via ``setup.py``).
36+
It is at this level (``pyro2/``) that the installation of pyro is done (via ``pyproject.toml``).
3737

3838
``pyro/``
3939
^^^^^^^^^

docs/source/installation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ The easiest way to install python is via PyPI using pip:
1717

1818
pip install pyro-hydro
1919

20-
Alternately, you can install from source, using the ``setup.py``.
20+
Alternately, you can install from source.
2121
From the ``pyro2/`` directory, we do:
2222

2323
.. prompt:: bash
2424

25-
python setup.py install --user
25+
pip install .
2626

2727
This will put the main driver, ``pyro_sim.py``, in your path, and
2828
allow you to run pyro from anywhere.
@@ -31,7 +31,7 @@ If you intend on directly developing the solvers, you can instead do:
3131

3232
.. prompt:: bash
3333

34-
python setup.py develop --user
34+
pip install -e .
3535

3636
This will allow you to modify the python source without having to
3737
reinstall each time something changes.

postBuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
python setup.py install
3+
pip install .
44

55

pyproject.toml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,63 @@
11
# pyproject.toml
22
[build-system]
3-
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]
3+
requires = ["setuptools>=64", "setuptools_scm>=8"]
4+
build-backend = "setuptools.build_meta"
5+
6+
7+
# project metadata
8+
9+
[project]
10+
name = "pyro-hydro"
11+
description = "A python hydrodynamics code for teaching and prototyping"
12+
readme = "README.md"
13+
license.text = "BSD"
14+
authors = [
15+
{name="pyro development group"},
16+
{email="michael.zingale@stonybrook.edu"},
17+
]
18+
dynamic = ["version"]
19+
20+
dependencies = [
21+
"numba",
22+
"numpy",
23+
"matplotlib",
24+
"h5py",
25+
]
26+
27+
[project.scripts]
28+
"pyro_sim.py" = "pyro.pyro_sim:main"
29+
30+
[project.urls]
31+
Homepage = "https://github.com/python-hydro/pyro2"
32+
Documentation = "https://python-hydro.github.io/pyro2"
33+
34+
# packaging
35+
36+
[tool.setuptools]
37+
zip-safe = false
38+
# we explicitly list the data we want below
39+
include-package-data = false
40+
41+
[tool.setuptools.packages.find]
42+
include = ["pyro*"]
43+
exclude = ["*.tests*"]
44+
namespaces = false
45+
46+
[tool.setuptools.package-data]
47+
# additional files to include when building a wheel
48+
pyro = [
49+
"_defaults",
50+
"**/_defaults",
51+
"**/*.defaults",
52+
"**/inputs*",
53+
"*/tests/*.h5"
54+
]
55+
56+
[tool.setuptools_scm]
57+
version_scheme = "post-release"
58+
version_file = "pyro/_version.py"
59+
60+
# development tools
461

562
[tool.pylint."MESSAGES CONTROL"]
663
disable = [

setup.py

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

0 commit comments

Comments
 (0)