From eee16f8fd7f58b4bcd14eca5652b04b1406910a5 Mon Sep 17 00:00:00 2001 From: "Adam R. Jensen" <39184289+AdamRJensen@users.noreply.github.com> Date: Mon, 9 Dec 2024 20:21:12 +0100 Subject: [PATCH] Remove setup.cfg in favor of pyproject.toml (#58) * Remove setup.cfg in favor of pyproject.toml * Convert [tool.coverage.run]omit to a list * Add [tool.setuptools_scm] * Address reviewer comments * Fix excluding folders * Move data folder to root * include-package-data = false --- ...976_irradiance_data_quality_controlled.csv | 0 docs/source/notebooks/validation.ipynb | 2 +- pyproject.toml | 64 ++++++++++++++++++- setup.cfg | 46 ------------- 4 files changed, 63 insertions(+), 49 deletions(-) rename {twoaxistracking/data => data}/barstow_1976_irradiance_data_quality_controlled.csv (100%) delete mode 100644 setup.cfg diff --git a/twoaxistracking/data/barstow_1976_irradiance_data_quality_controlled.csv b/data/barstow_1976_irradiance_data_quality_controlled.csv similarity index 100% rename from twoaxistracking/data/barstow_1976_irradiance_data_quality_controlled.csv rename to data/barstow_1976_irradiance_data_quality_controlled.csv diff --git a/docs/source/notebooks/validation.ipynb b/docs/source/notebooks/validation.ipynb index 6ac3e70..3bff227 100644 --- a/docs/source/notebooks/validation.ipynb +++ b/docs/source/notebooks/validation.ipynb @@ -229,7 +229,7 @@ } ], "source": [ - "filename = '../../../twoaxistracking/data/barstow_1976_irradiance_data_quality_controlled.csv'\n", + "filename = '../../../data/barstow_1976_irradiance_data_quality_controlled.csv'\n", "df = pd.read_csv(filename, index_col=0, parse_dates=[0])\n", "\n", "df.head() # print the first five rows of the dataframe" diff --git a/pyproject.toml b/pyproject.toml index 374b58c..1b29df9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,66 @@ [build-system] requires = [ - "setuptools>=42", - "wheel" + "setuptools>61", # start of support for pyproject.toml/PEP 621. https://setuptools.pypa.io/en/stable/history.html#v61-0-0 + "setuptools-scm", ] build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] # set version dynamically + +[tool.setuptools] +include-package-data = false # necessary for exclude to work + +[tool.setuptools.packages.find] +exclude = [ + "twoaxistracking.tests*", + "docs*", +] + +[project] +name = "twoaxistracking" +authors = [ + {name = "Adam R. Jensen"}, + {name = "Kevin S. Anderson"}, + {email = "adam-r-j@hotmail.com"}, +] +description = "twoaxistracking is a python package for simulating two-axis tracking solar collectors, particularly self-shading." +readme = "README.md" +requires-python = ">=3.9" +keywords = ["solar energy", "photovoltaics", "solar collector", "shading"] +license = {file = "LICENSE"} +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering", + "Intended Audience :: Science/Research", +] +dependencies = [ + "numpy", + "matplotlib", + "shapely", + "pandas", +] +dynamic = ["version"] + +[project.optional-dependencies] +test = ["pytest", "pytest-cov", "packaging"] +doc = [ + "sphinx==8.1.1", + "myst-nb==1.1.2", + "sphinx-book-theme==1.1.3", + "pvlib==0.11.1", + "pandas==2.2.3", +] + +[project.urls] +Documentation = "https://twoaxistracking.readthedocs.io" +Issues = "https://github.com/pvlib/twoaxistracking/issues" +Repository = "https://github.com/pvlib/twoaxistracking.git" + +[tool.pytest.ini_options] +addopts = "--cov=twoaxistracking --cov-fail-under=100 --cov-report=term-missing" + +[tool.coverage.run] +# Do not count the test files themselves toward coverage +omit = ["twoaxistracking/tests/*"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a614abf..0000000 --- a/setup.cfg +++ /dev/null @@ -1,46 +0,0 @@ -[metadata] -name = twoaxistracking -version = 0.2.5 -author = 'Adam R. Jensen, Kevin Anderson' -author_email = adam-r-j@hotmail.com -description = twoaxistracking is a python package for simulating two-axis tracking solar collectors, particularly self-shading. -long_description = file: README.md -long_description_content_type = text/markdown -url = https://github.com/pvlib/twoaxistracking -project_urls = - Bug Tracker = https://github.com/pvlib/twoaxistracking/issues - Documentation = https://twoaxistracking.readthedocs.io -classifiers = - Programming Language :: Python :: 3 - License :: OSI Approved :: BSD License - Operating System :: OS Independent - Topic :: Scientific/Engineering - Intended Audience :: Science/Research - -[options] -packages = twoaxistracking -python_requires = >=3.9 -install_requires = - numpy - matplotlib - shapely - pandas - -[options.extras_require] -test = - pytest - pytest-cov - packaging -doc = - sphinx==8.1.1 - myst-nb==1.1.2 - sphinx-book-theme==1.1.3 - pvlib==0.11.1 - pandas==2.2.3 - -[tool:pytest] -addopts = --cov=twoaxistracking --cov-fail-under=100 --cov-report=term-missing - -[coverage:run] -# don't count the test files themselves towards coverage -omit = twoaxistracking/tests/*