Skip to content

Commit

Permalink
Use pep517/518 build system for modern build isolation (#1495)
Browse files Browse the repository at this point in the history
- Remove pvlib/_version.py (versioneer)
- Use importlib.metadata to retrieve version from PKG-INFO
- Add importlib-metadata backport for python < 3.8
- Create pyproject.toml with setuptools build backend
- Update workflow to use pypa/build module to build sdist & wheel
- Update remove versioneer files from .lgtm.yml & .stickler.yml
- Remove include from MANIFEST.IN (already included with setuptools-scm)
  • Loading branch information
jules-ch authored Aug 16, 2022
1 parent 4d75e25 commit b2eca71
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 2,326 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[run]
omit = pvlib/_version.py
omit = pvlib/version.py
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
pvlib/version.py export-subst

# reduce the number of merge conflicts
docs/sphinx/source/whatsnew/* merge=union
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install build
- name: Build packages
run: python setup.py sdist bdist_wheel
run: python -m build

# only publish distribution to PyPI for tagged commits
- name: Publish distribution to PyPI
Expand Down
3 changes: 0 additions & 3 deletions .lgtm.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
path_classifiers:
generated:
- pvlib/_version.py
library:
- versioneer.py
- pvlib/_deprecation.py
2 changes: 1 addition & 1 deletion .stickler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ linters:
ignore: E201,E241,E226,W503,W504
files:
ignore:
- 'pvlib/_version.py'
- 'pvlib/version.py'
16 changes: 0 additions & 16 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
include MANIFEST.in
include AUTHORS.md
include LICENSE
include README.md
include setup.py

# include most everything under pvlib by default
# better to package too much than not enough
graft pvlib

# we included pvlib files needed to compile NREL SPA code in graft above,
# now we exclude the NREL code itself to comply with their license
global-exclude */spa.c
global-exclude */spa.h
prune pvlib/spa_c_files/build

graft docs
prune docs/sphinx/build
prune docs/sphinx/source/generated
# all doc figures created by doc build
Expand All @@ -30,6 +17,3 @@ global-exclude .DS_Store
global-exclude .git*
global-exclude \#*
global-exclude .ipynb_checkpoints

include versioneer.py
include pvlib/_version.py
2 changes: 2 additions & 0 deletions docs/sphinx/source/whatsnew/v0.9.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Enhancements
* Improve error message about uneven time intervals for
:py:func:`~pvlib.clearsky.detect_clearsky` and :py:func:`~pvlib.temperature.prilliman`
(:issue:`1476`, :pull:`1490`)
* Add support for `PEP517 <https://peps.python.org/pep-0517/>`_ & `PEP518 <https://peps.python.org/pep-0518/>`_
with setuptools build backend. (:pull:`1495`)

Bug fixes
~~~~~~~~~
Expand Down
Loading

0 comments on commit b2eca71

Please sign in to comment.