Skip to content

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

Merged
matthewfeickert merged 5 commits intomasterfrom
build/set-package-date
Jun 10, 2022
Merged

build: Use find_namespace: to ensure discovery of package data#1881
matthewfeickert merged 5 commits intomasterfrom
build/set-package-date

Conversation

@matthewfeickert
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

Thanks @henryiii!

@matthewfeickert matthewfeickert merged commit ebcc964 into master Jun 10, 2022
@matthewfeickert matthewfeickert deleted the build/set-package-date branch June 10, 2022 14:38
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