From a64d9e368206d4eaa78cbbf91ef7bb93bdbc71c4 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 16 Apr 2025 15:22:08 -0400 Subject: [PATCH 1/8] replace setup.py with pyproject.toml --- pyproject.toml | 75 +++++++++++++++++++++++++++++++++++++++++ setup.py | 90 -------------------------------------------------- 2 files changed, 75 insertions(+), 90 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..670d3b9b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,75 @@ +[build-system] +requires = ["setuptools>=70.1", "setuptools_scm>=6.2"] +build-backend = "setuptools.build_meta" + + +[project] +name = "pvanalytics" +description = "PVAnalytics is a python library for the analysis of photovoltaic system-level data." +authors = [ + { name = "pvanalytics Contributors", email = "pvlib-admin@googlegroups.com" }, +] +requires-python = ">=3.8" +dependencies = [ + 'numpy >= 1.17.0', + 'pandas >= 1.0.0, != 1.1.*', + 'pvlib >= 0.9.4', + 'scipy >= 1.6.0', + 'statsmodels >= 0.10.0', + 'scikit-image >= 0.16.0', +] +license = "MIT" +classifiers = [ + 'Development Status :: 4 - Beta', + 'Operating System :: OS Independent', + 'Intended Audience :: Science/Research', + 'Programming Language :: Python :: 3', + 'Topic :: Scientific/Engineering', +] +readme.text = """ +PVAnalytics is a collection of functions for working with data +from photovoltaic power systems. The library includes functions for +general data quality tests such as outlier detection, validation that +data is physically plausible, filtering data for specific conditions, +and labeling specific features in the data. + +Documentation: https://pvanalytics.readthedocs.io + +Source code: https://github.com/pvlib/pvanalytics +""" +readme.content-type = "text/x-rst" +dynamic = ["version"] + + +[project.optional-dependencies] +optional = [ + 'ruptures', +] +doc = [ + 'sphinx == 4.5.0', + 'pydata-sphinx-theme == 0.8.1', + 'sphinx-gallery', + 'matplotlib', + 'pyarrow' +] +test = [ + 'pytest', + 'pytest-cov', + 'packaging', +] +all = ["pvlib[test,optional,doc]"] + +[project.urls] +"Bug Tracker" = "https://github.com/pvlib/pvanalytics/issues" +Documentation = "https://pvanalytics.readthedocs.io/" +"Source Code" = "https://github.com/pvlib/pvanalytics" + + +[tool.setuptools.packages.find] +include = ["pvanalytics*"] + + +[tool.setuptools.package-data] +pvanalytics = ["pvanalytics/data/*"] + +[tool.setuptools_scm] diff --git a/setup.py b/setup.py deleted file mode 100644 index c489a091..00000000 --- a/setup.py +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env python - -try: - from setuptools import setup, find_packages -except ImportError: - raise RuntimeError('setuptools is required') - -DESCRIPTION = ('PVAnalytics is a python library for the analysis of ' + - 'photovoltaic system-level data.') - -LONG_DESCRIPTION = """ -PVAnalytics is a collection of functions for working with data -from photovoltaic power systems. The library includes functions for -general data quality tests such as outlier detection, validation that -data is physically plausible, filtering data for specific conditions, -and labeling specific features in the data. - -Documentation: https://pvanalytics.readthedocs.io - -Source code: https://github.com/pvlib/pvanalytics -""" - -DISTNAME = 'pvanalytics' -AUTHOR = 'pvanalytics Contributors' -MAINTAINER_EMAIL = 'pvlib-admin@googlegroups.com' -LICENSE = 'MIT' -URL = 'https://github.com/pvlib/pvanalytics' - -TESTS_REQUIRE = [ - 'pytest', - 'pytest-cov', - 'packaging', -] - -INSTALL_REQUIRES = [ - 'numpy >= 1.17.0', - 'pandas >= 1.0.0, != 1.1.*', - 'pvlib >= 0.9.4', - 'scipy >= 1.6.0', - 'statsmodels >= 0.10.0', - 'scikit-image >= 0.16.0', - 'importlib-metadata; python_version < "3.8"', -] - -DOCS_REQUIRE = [ - 'sphinx == 4.5.0', - 'pydata-sphinx-theme == 0.8.1', - 'sphinx-gallery', - 'matplotlib', - 'pyarrow' -] - -EXTRAS_REQUIRE = { - 'optional': ['ruptures'], - 'test': TESTS_REQUIRE, - 'doc': DOCS_REQUIRE -} - -EXTRAS_REQUIRE['all'] = sorted(set(sum(EXTRAS_REQUIRE.values(), []))) - -SETUP_REQUIRES = ['setuptools_scm'] - -CLASSIFIERS = [ - 'Development Status :: 4 - Beta', - 'Operating System :: OS Independent', - 'Intended Audience :: Science/Research', - 'Programming Language :: Python :: 3', - 'Topic :: Scientific/Engineering' -] - -PACKAGES = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]) - -setup( - name=DISTNAME, - use_scm_version=True, - packages=PACKAGES, - install_requires=INSTALL_REQUIRES, - extras_require=EXTRAS_REQUIRE, - tests_require=TESTS_REQUIRE, - setup_requires=SETUP_REQUIRES, - ext_modules=[], - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - author=AUTHOR, - maintainer_email=MAINTAINER_EMAIL, - license=LICENSE, - classifiers=CLASSIFIERS, - url=URL, - include_package_data=True, -) From 6eda01d454ef42132bce9c40e8f64019afaf41e2 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 16 Apr 2025 15:23:45 -0400 Subject: [PATCH 2/8] update distribution workflow --- .github/workflows/pythonpublish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml index e137920f..592bed54 100644 --- a/.github/workflows/pythonpublish.yml +++ b/.github/workflows/pythonpublish.yml @@ -16,11 +16,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install build twine - name: Build and publish env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: | - python setup.py sdist bdist_wheel + python -m build twine upload dist/* From 2957042e9114a8688d1ee09038d440a6e50ce13a Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 16 Apr 2025 15:23:57 -0400 Subject: [PATCH 3/8] remove unneeded entries from MANIFEST --- MANIFEST.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index c3092acc..62af3311 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,2 @@ -prune .github -exclude .gitignore -exclude .readthedocs.yml -exclude .travis.yml graft pvanalytics/data From fa18e3d038bc140a46c3c63bc36249181f3177e0 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 16 Apr 2025 15:34:58 -0400 Subject: [PATCH 4/8] replace docs mention of setup.py --- docs/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index be4e5b43..037e5bbd 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -80,7 +80,7 @@ It supports: Additionally, PVAnalytics relies on several other packages in the open source scientific python ecosystem. For details on dependencies and versions, -see our `setup.py `_. +see our `pyproject.toml `_. .. toctree:: From 5a3a37acd94804da48d573c08bafb0bdc54c7033 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 23 Apr 2025 13:21:11 -0400 Subject: [PATCH 5/8] pin sphinxcontrib-applehelp in doc requirements --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 670d3b9b..fdfa6591 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,7 @@ optional = [ ] doc = [ 'sphinx == 4.5.0', + 'sphinxcontrib-applehelp == 1.0.7', # needed for sphinx < 5, https://github.com/sphinx-doc/sphinx/issues/11890 'pydata-sphinx-theme == 0.8.1', 'sphinx-gallery', 'matplotlib', From 8c0146a72a5514104250f7a0b8d035b76950d493 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 23 Apr 2025 14:57:00 -0400 Subject: [PATCH 6/8] merge in setup.py updates from #220 --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fdfa6591..dba82b05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,12 +11,12 @@ authors = [ ] requires-python = ">=3.8" dependencies = [ - 'numpy >= 1.17.0', - 'pandas >= 1.0.0, != 1.1.*', + 'numpy >= 1.20.0', + 'pandas >= 1.3.0', 'pvlib >= 0.9.4', 'scipy >= 1.6.0', - 'statsmodels >= 0.10.0', - 'scikit-image >= 0.16.0', + 'statsmodels >= 0.13.0', + 'scikit-image >= 0.18.0', ] license = "MIT" classifiers = [ From 613ec2e5da6fab0abd87d35c04a2b2a05b880792 Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 23 Apr 2025 15:01:12 -0400 Subject: [PATCH 7/8] fix incorrect pinned version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dba82b05..0a22f379 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ optional = [ ] doc = [ 'sphinx == 4.5.0', - 'sphinxcontrib-applehelp == 1.0.7', # needed for sphinx < 5, https://github.com/sphinx-doc/sphinx/issues/11890 + 'sphinxcontrib-applehelp == 1.0.4', # needed for sphinx < 5, https://github.com/sphinx-doc/sphinx/issues/11890 'pydata-sphinx-theme == 0.8.1', 'sphinx-gallery', 'matplotlib', From 8b29a8649efa5f180fb69503b61607b8cf7d8ceb Mon Sep 17 00:00:00 2001 From: Kevin Anderson Date: Wed, 23 Apr 2025 15:06:15 -0400 Subject: [PATCH 8/8] more pins to fix docs build --- pyproject.toml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0a22f379..47921642 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,11 +47,19 @@ optional = [ ] doc = [ 'sphinx == 4.5.0', - 'sphinxcontrib-applehelp == 1.0.4', # needed for sphinx < 5, https://github.com/sphinx-doc/sphinx/issues/11890 'pydata-sphinx-theme == 0.8.1', 'sphinx-gallery', 'matplotlib', - 'pyarrow' + 'pyarrow', + # the following are needed for sphinx < 5. TODO upgrade to sphinx>5, and + # get rid of these pins. + # https://github.com/sphinx-doc/sphinx/issues/11890 + # https://stackoverflow.com/questions/77848565/sphinxcontrib-applehelp-breaking-sphinx-builds-with-sphinx-version-less-than-5-0 + 'sphinxcontrib-applehelp==1.0.4', + 'sphinxcontrib-devhelp==1.0.2', + 'sphinxcontrib-htmlhelp==2.0.1', + 'sphinxcontrib-qthelp==1.0.3', + 'sphinxcontrib-serializinghtml==1.1.5', ] test = [ 'pytest',