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/* 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 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:: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..47921642 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,84 @@ +[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.20.0', + 'pandas >= 1.3.0', + 'pvlib >= 0.9.4', + 'scipy >= 1.6.0', + 'statsmodels >= 0.13.0', + 'scikit-image >= 0.18.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', + # 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', + '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 c67c4e56..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.20.0', - 'pandas >= 1.3.0', - 'pvlib >= 0.9.4', - 'scipy >= 1.6.0', - 'statsmodels >= 0.13.0', - 'scikit-image >= 0.18.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, -)