Skip to content

Commit 22565cd

Browse files
authored
Switch from setup.py to pyproject.toml (#219)
* replace setup.py with pyproject.toml * update distribution workflow * remove unneeded entries from MANIFEST * replace docs mention of setup.py * pin sphinxcontrib-applehelp in doc requirements * merge in setup.py updates from #220 * fix incorrect pinned version * more pins to fix docs build
1 parent 28f7a32 commit 22565cd

File tree

5 files changed

+87
-97
lines changed

5 files changed

+87
-97
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
- name: Install dependencies
1717
run: |
1818
python -m pip install --upgrade pip
19-
pip install setuptools wheel twine
19+
pip install build twine
2020
- name: Build and publish
2121
env:
2222
TWINE_USERNAME: __token__
2323
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
2424
run: |
25-
python setup.py sdist bdist_wheel
25+
python -m build
2626
twine upload dist/*

MANIFEST.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
prune .github
2-
exclude .gitignore
3-
exclude .readthedocs.yml
4-
exclude .travis.yml
51

62
graft pvanalytics/data

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ It supports:
8080

8181
Additionally, PVAnalytics relies on several other packages in the open
8282
source scientific python ecosystem. For details on dependencies and versions,
83-
see our `setup.py <https://github.com/pvlib/pvanalytics/blob/main/setup.py>`_.
83+
see our `pyproject.toml <https://github.com/pvlib/pvanalytics/blob/main/pyproject.toml>`_.
8484

8585

8686
.. toctree::

pyproject.toml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
[build-system]
2+
requires = ["setuptools>=70.1", "setuptools_scm>=6.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
6+
[project]
7+
name = "pvanalytics"
8+
description = "PVAnalytics is a python library for the analysis of photovoltaic system-level data."
9+
authors = [
10+
{ name = "pvanalytics Contributors", email = "[email protected]" },
11+
]
12+
requires-python = ">=3.8"
13+
dependencies = [
14+
'numpy >= 1.20.0',
15+
'pandas >= 1.3.0',
16+
'pvlib >= 0.9.4',
17+
'scipy >= 1.6.0',
18+
'statsmodels >= 0.13.0',
19+
'scikit-image >= 0.18.0',
20+
]
21+
license = "MIT"
22+
classifiers = [
23+
'Development Status :: 4 - Beta',
24+
'Operating System :: OS Independent',
25+
'Intended Audience :: Science/Research',
26+
'Programming Language :: Python :: 3',
27+
'Topic :: Scientific/Engineering',
28+
]
29+
readme.text = """
30+
PVAnalytics is a collection of functions for working with data
31+
from photovoltaic power systems. The library includes functions for
32+
general data quality tests such as outlier detection, validation that
33+
data is physically plausible, filtering data for specific conditions,
34+
and labeling specific features in the data.
35+
36+
Documentation: https://pvanalytics.readthedocs.io
37+
38+
Source code: https://github.com/pvlib/pvanalytics
39+
"""
40+
readme.content-type = "text/x-rst"
41+
dynamic = ["version"]
42+
43+
44+
[project.optional-dependencies]
45+
optional = [
46+
'ruptures',
47+
]
48+
doc = [
49+
'sphinx == 4.5.0',
50+
'pydata-sphinx-theme == 0.8.1',
51+
'sphinx-gallery',
52+
'matplotlib',
53+
'pyarrow',
54+
# the following are needed for sphinx < 5. TODO upgrade to sphinx>5, and
55+
# get rid of these pins.
56+
# https://github.com/sphinx-doc/sphinx/issues/11890
57+
# https://stackoverflow.com/questions/77848565/sphinxcontrib-applehelp-breaking-sphinx-builds-with-sphinx-version-less-than-5-0
58+
'sphinxcontrib-applehelp==1.0.4',
59+
'sphinxcontrib-devhelp==1.0.2',
60+
'sphinxcontrib-htmlhelp==2.0.1',
61+
'sphinxcontrib-qthelp==1.0.3',
62+
'sphinxcontrib-serializinghtml==1.1.5',
63+
]
64+
test = [
65+
'pytest',
66+
'pytest-cov',
67+
'packaging',
68+
]
69+
all = ["pvlib[test,optional,doc]"]
70+
71+
[project.urls]
72+
"Bug Tracker" = "https://github.com/pvlib/pvanalytics/issues"
73+
Documentation = "https://pvanalytics.readthedocs.io/"
74+
"Source Code" = "https://github.com/pvlib/pvanalytics"
75+
76+
77+
[tool.setuptools.packages.find]
78+
include = ["pvanalytics*"]
79+
80+
81+
[tool.setuptools.package-data]
82+
pvanalytics = ["pvanalytics/data/*"]
83+
84+
[tool.setuptools_scm]

setup.py

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

0 commit comments

Comments
 (0)