Skip to content

Commit

Permalink
setup.py: use setuptools.find_namespace_packages() (#1483)
Browse files Browse the repository at this point in the history
* setup.py: use setuptools.find_packages()

* switch to better method; add documentation

* more comment

* use stable pypi release action

should hopefully address and silence this warning:
Warning: You are using "pypa/gh-action-pypi-publish@master". The "master" branch of this project has been sunset and will not receive any updates, not even security bug fixes. Please, make sure to use a supported version. If you want to pin to v1 major version, use "pypa/gh-action-pypi-publish@release/v1". If you feel adventurous, you may opt to use use "pypa/gh-action-pypi-publish@unstable/v1" instead. A more general recommendation is to pin to exact tags or commit shas.

* some pruning

* fix errors
  • Loading branch information
kandersolar committed Aug 17, 2022
1 parent 798799a commit 3692427
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
# only publish distribution to PyPI for tagged commits
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
12 changes: 12 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,15 @@ global-exclude .DS_Store
global-exclude .git*
global-exclude \#*
global-exclude .ipynb_checkpoints

exclude .coveragerc
exclude .lgtm.yml
exclude .stickler.yml
exclude codecov.yml
exclude readthedocs.yml
exclude CODE_OF_CONDUCT.md

prune paper
prune .github
prune benchmarks
prune ci
14 changes: 12 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys

try:
from setuptools import setup
from setuptools import setup, find_namespace_packages
from setuptools.extension import Extension
except ImportError:
raise RuntimeError('setuptools is required')
Expand Down Expand Up @@ -82,7 +82,17 @@
}

# set up pvlib packages to be installed and extensions to be compiled
PACKAGES = ['pvlib']

# the list of packages is not just the top-level "pvlib", but also
# all sub-packages like "pvlib.bifacial". Here, setuptools's definition of
# "package" is, in effect, any directory you want to include in the
# distribution. So even "pvlib.data" counts as a package, despite
# not having any python code or even an __init__.py.
# setuptools.find_namespace_packages() will find all these directories,
# although to exclude "docs", "ci", etc., we include only names matching
# the "pvlib*" glob. Although note that "docs" does get added separately
# via the MANIFEST.in spec.
PACKAGES = find_namespace_packages(include=['pvlib*'])

extensions = []

Expand Down

0 comments on commit 3692427

Please sign in to comment.