Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py: use setuptools.find_namespace_packages() #1483

Merged
merged 8 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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