Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all metadata to pyproject.toml #1026

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build twine
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the change that hung us up over on FLASC---presumably as long as thee python -m build line runs below, it should upload to PyPI correctly?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right, I think I've gotten to learn from that and now this should go off fine, easy to test locally too but you don't want to run the twine call

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, ok, makes sense

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to fully test it, you could use the TestPyPI instance. If you did that, you could create a release on your fork and see that it uploads correctly without affecting anything on the primary repository.

Also heads up that this pull request is pointing to main rather than develop. Maybe that was intentional, but just pointing it out in case it wasn't.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should've been develop, moved over now

- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
4 changes: 2 additions & 2 deletions docs/dev_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ is located at `floris/.github/workflows/continuous-integration-workflow.yaml`.
The online documentation is built with Jupyter Book which uses Sphinx
as a framework. It is automatically built and hosted by GitHub, but it
can also be compiled locally. Additional dependencies are required
for the documentation, and they are listed in the `EXTRAS` of `setup.py`.
for the documentation, and they are listed in the `project.optional-dependencies` of `pyproject.toml`.
The commands to build the docs are given below. After successfully
compiling, a file should be located at ``docs/_build/html/index.html``.
This file can be opened in any browser.
Expand Down Expand Up @@ -246,7 +246,7 @@ Be sure to complete each step in the sequence as described.
with a commit message such as "Update version to vN.M".
The version number must be updated in the following two files:
- [floris/README.md](https://github.com/NREL/floris/blob/main/README.md)
- [floris/floris/version.py](https://github.com/NREL/floris/blob/main/floris/version.py)
- [pyproject.toml](https://github.com/NREL/floris/blob/main/pyproject.toml)
Note that a `.0` version number is left off meaning that valid versions
are `v3`, `v3.1`, `v3.1.1`, etc.

Expand Down
4 changes: 2 additions & 2 deletions floris/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

from importlib.metadata import version
from pathlib import Path


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


from .floris_model import FlorisModel
Expand Down
1 change: 0 additions & 1 deletion floris/version.py

This file was deleted.

65 changes: 65 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,71 @@
requires = ["setuptools >= 40.6.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "floris"
version = "4.2"
description = "A controls-oriented engineering wake model."
readme = "README.md"
requires-python = ">=3.8"
authors = [
{ name = "Rafael Mudafort", email = "[email protected]" },
{ name = "Paul Fleming", email = "[email protected]" },
{ name = "Michael (Misha) Sinner", email = "[email protected]" },
{ name = "Eric Simley", email = "[email protected]" },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably add Chris, too

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added!

{ name = "Christopher Bay", email = "[email protected]" },
]
license = { file = "LICENSE.txt" }
keywords = ["floris"]
classifiers = [
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
]
dependencies = [
"attrs",
"pyyaml~=6.0",
"numexpr~=2.0",
"numpy~=1.20",
"scipy~=1.1",
"matplotlib~=3.0",
"pandas~=2.0",
"shapely~=2.0",
"coloredlogs~=15.0",
"pathos~=0.3",
]

[project.optional-dependencies]
docs = [
"jupyter-book",
"sphinx-book-theme",
"sphinx-autodoc-typehints",
"sphinxcontrib-autoyaml",
"sphinxcontrib.mermaid",
]
develop = [
"pytest",
"pre-commit",
"ruff",
"isort"
]

[tool.setuptools.packages.find]
include = ["floris*"]

[tool.setuptools.package-data]
floris = [
"turbine_library/*.yaml",
"core/wake_velocity/turbopark_lookup_table.mat"
]

[project.urls]
Homepage = "https://github.com/NREL/floris"
Documentation = "https://nrel.github.io/floris/"

[coverage.run]
# Coverage.py configuration file
Expand Down
89 changes: 0 additions & 89 deletions setup.py

This file was deleted.

Loading