Skip to content

Commit dff48cd

Browse files
authored
Move all metadata to pyproject.toml (#1026)
1 parent 6fca3fb commit dff48cd

File tree

6 files changed

+71
-96
lines changed

6 files changed

+71
-96
lines changed

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install setuptools wheel twine
23+
pip install build twine
2424
- name: Build and publish
2525
env:
2626
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
2727
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2828
run: |
29-
python setup.py sdist bdist_wheel
29+
python -m build
3030
twine upload dist/*

docs/dev_guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ is located at `floris/.github/workflows/continuous-integration-workflow.yaml`.
210210
The online documentation is built with Jupyter Book which uses Sphinx
211211
as a framework. It is automatically built and hosted by GitHub, but it
212212
can also be compiled locally. Additional dependencies are required
213-
for the documentation, and they are listed in the `EXTRAS` of `setup.py`.
213+
for the documentation, and they are listed in the `project.optional-dependencies` of `pyproject.toml`.
214214
The commands to build the docs are given below. After successfully
215215
compiling, a file should be located at ``docs/_build/html/index.html``.
216216
This file can be opened in any browser.
@@ -246,7 +246,7 @@ Be sure to complete each step in the sequence as described.
246246
with a commit message such as "Update version to vN.M".
247247
The version number must be updated in the following two files:
248248
- [floris/README.md](https://github.com/NREL/floris/blob/main/README.md)
249-
- [floris/floris/version.py](https://github.com/NREL/floris/blob/main/floris/version.py)
249+
- [pyproject.toml](https://github.com/NREL/floris/blob/main/pyproject.toml)
250250
Note that a `.0` version number is left off meaning that valid versions
251251
are `v3`, `v3.1`, `v3.1.1`, etc.
252252

floris/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

2+
from importlib.metadata import version
23
from pathlib import Path
34

45

5-
with open(Path(__file__).parent / "version.py") as _version_file:
6-
__version__ = _version_file.read().strip()
6+
__version__ = version("floris")
77

88

99
from .floris_model import FlorisModel

floris/version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,71 @@
22
requires = ["setuptools >= 40.6.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

5+
[project]
6+
name = "floris"
7+
version = "4.2"
8+
description = "A controls-oriented engineering wake model."
9+
readme = "README.md"
10+
requires-python = ">=3.8"
11+
authors = [
12+
{ name = "Rafael Mudafort", email = "[email protected]" },
13+
{ name = "Paul Fleming", email = "[email protected]" },
14+
{ name = "Michael (Misha) Sinner", email = "[email protected]" },
15+
{ name = "Eric Simley", email = "[email protected]" },
16+
{ name = "Christopher Bay", email = "[email protected]" },
17+
]
18+
license = { file = "LICENSE.txt" }
19+
keywords = ["floris"]
20+
classifiers = [
21+
"License :: OSI Approved :: BSD License",
22+
"Programming Language :: Python",
23+
"Programming Language :: Python :: 3",
24+
"Programming Language :: Python :: 3.8",
25+
"Programming Language :: Python :: 3.9",
26+
"Programming Language :: Python :: 3.10",
27+
"Programming Language :: Python :: Implementation :: CPython",
28+
"Programming Language :: Python :: Implementation :: PyPy"
29+
]
30+
dependencies = [
31+
"attrs",
32+
"pyyaml~=6.0",
33+
"numexpr~=2.0",
34+
"numpy~=1.20",
35+
"scipy~=1.1",
36+
"matplotlib~=3.0",
37+
"pandas~=2.0",
38+
"shapely~=2.0",
39+
"coloredlogs~=15.0",
40+
"pathos~=0.3",
41+
]
42+
43+
[project.optional-dependencies]
44+
docs = [
45+
"jupyter-book",
46+
"sphinx-book-theme",
47+
"sphinx-autodoc-typehints",
48+
"sphinxcontrib-autoyaml",
49+
"sphinxcontrib.mermaid",
50+
]
51+
develop = [
52+
"pytest",
53+
"pre-commit",
54+
"ruff",
55+
"isort"
56+
]
57+
58+
[tool.setuptools.packages.find]
59+
include = ["floris*"]
60+
61+
[tool.setuptools.package-data]
62+
floris = [
63+
"turbine_library/*.yaml",
64+
"core/wake_velocity/turbopark_lookup_table.mat"
65+
]
66+
67+
[project.urls]
68+
Homepage = "https://github.com/NREL/floris"
69+
Documentation = "https://nrel.github.io/floris/"
570

671
[coverage.run]
772
# Coverage.py configuration file

setup.py

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

0 commit comments

Comments
 (0)