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

build: Use find_namespace: to ensure discovery of package data #1881

Merged
merged 5 commits into from
Jun 10, 2022

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Jun 10, 2022

Description

Resolves #1880

Use find_namespace: in conjunction with include_package_data = True in setup.cfg to properly find package data (pyhf.data and pyhf.schemas) during build of sdist and wheel. The recommendation from setuptools is to treat the data/ and schemas/ subdirectories as namespace packages given PEP 420.

Checklist Before Requesting Reviewer

  • Tests are passing
  • "WIP" removed from the title of the pull request
  • Selected an Assignee for the PR to be responsible for the log summary

Before Merging

For the PR Assignees:

  • Summarize commit messages into a comprehensive review of the PR
* Use `find_namespace:` in conjunction with `include_package_data = True` in setup.cfg
to properly find package data (pyhf.data and pyhf.schemas) during build of sdist
and wheel.
   - The recommendation from setuptools is to treat the data/ and schemas/ subdirectories as
     namespace packages given PEP 420 (https://peps.python.org/pep-0420/).
   - c.f. https://setuptools.pypa.io/en/stable/userguide/datafiles.html#subdirectory-for-data-files

@matthewfeickert matthewfeickert added build Changes that affect the build system or external dependencies packaging setup.py, setup.cfg, pyproject.toml, and friends labels Jun 10, 2022
@matthewfeickert matthewfeickert self-assigned this Jun 10, 2022
@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #1881 (566a0af) into master (4682725) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1881   +/-   ##
=======================================
  Coverage   98.17%   98.17%           
=======================================
  Files          68       68           
  Lines        4322     4322           
  Branches      726      726           
=======================================
  Hits         4243     4243           
  Misses         46       46           
  Partials       33       33           
Flag Coverage Δ
contrib 26.39% <ø> (ø)
doctest 60.73% <ø> (ø)
unittests-3.10 96.04% <ø> (ø)
unittests-3.7 96.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4682725...566a0af. Read the comment docs.

@matthewfeickert
Copy link
Member Author

matthewfeickert commented Jun 10, 2022

$ python -m build .

is no longer reporting the SetuptoolsDeprecationWarning of Issue #1880. 👍 @henryiii, as the resident Scikit-HEP packaging expert, if we can bug you for a cross check here that would be great.

@henryiii
Copy link
Member

Given you use a src/ directory, I think this is all that's needed. (If not, you'd need to ideally protect directories like tests and docs).

@matthewfeickert
Copy link
Member Author

Thanks @henryiii!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Changes that affect the build system or external dependencies packaging setup.py, setup.cfg, pyproject.toml, and friends
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'pyhf.data' needs to be listed as a pacakge as installing as data is deprecated
2 participants