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

MANIFEST.in discrepant behavior between non-scikit-build and scikit-build projects #537

Open
kratsg opened this issue May 12, 2021 · 2 comments

Comments

@kratsg
Copy link
Contributor

kratsg commented May 12, 2021

It seems that fundamentally, scikit-build is treating the .* differently than how setuptools seems to treat it. Take for instance, this MANIFEST.in from pyhf:

prune *
graft src 
include LICENSE
exclude lower-bound-requirements.txt

global-exclude __pycache__ *.py[cod] .*

If I use something similar on a scikit-build project

prune *
graft src 
include LICENSE

global-exclude __pycache__ *.py[cod] .*

I find that none of the files are being picked up (because of this global-exclude at the end). However, if I tweak that last line instead to be

global-exclude __pycache__ *.py[cod]

then it works as expected. This is not so obvious at first glance, and it would be really nice to have something like #402 in.

@matthewfeickert
Copy link

@kratsg Seems that we don't actually need that in pyhf (I'm not sure why I first put that .* in) as if I remove it

--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -3,4 +3,4 @@ graft src
 include LICENSE
 exclude lower-bound-requirements.txt
 
-global-exclude __pycache__ *.py[cod] .*
+global-exclude __pycache__ *.py[cod]

and then check with check-manifest everything seems okay

# check-manifest .
lists of files in version control and sdist match

and the build using build works as before.

$ docker run --rm -ti python:3.8 /bin/bash
# python -m pip install --upgrade --quiet pip setuptools wheel
# python -m pip install --quiet build check-manifest
# pip list
Package        Version
-------------- -----------
build          0.3.1.post1
check-manifest 0.46
packaging      20.9
pep517         0.10.0
pip            21.1.1
pyparsing      2.4.7
setuptools     56.2.0
toml           0.10.2
wheel          0.36.2
# git clone https://github.com/scikit-hep/pyhf.git
# cd pyhf
# apt update -y && apt install -y vim
# vi MANIFEST.in 
# git diff
diff --git a/MANIFEST.in b/MANIFEST.in
index 1c9b062..e38e11c 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -3,4 +3,4 @@ graft src
 include LICENSE
 exclude lower-bound-requirements.txt
 
-global-exclude __pycache__ *.py[cod] .*
+global-exclude __pycache__ *.py[cod]
# check-manifest .
lists of files in version control and sdist match
# python -m build --sdist --wheel --outdir dist/ .
# ls -l dist/
total 252
-rw-r--r-- 1 root root 140527 May 12 03:47 pyhf-0.6.2.dev41-py3-none-any.whl
-rw-r--r-- 1 root root 110752 May 12 03:47 pyhf-0.6.2.dev41.tar.gz
# python -m pip install dist/pyhf-0.6.2.dev41-py3-none-any.whl
# pip list
Package        Version
-------------- -----------
attrs          21.2.0
build          0.3.1.post1
check-manifest 0.46
click          8.0.0
jsonpatch      1.32
jsonpointer    2.1
jsonschema     3.2.0
numpy          1.20.3
packaging      20.9
pep517         0.10.0
pip            21.1.1
pyhf           0.6.2.dev41
pyparsing      2.4.7
pyrsistent     0.17.3
PyYAML         5.4.1
scipy          1.6.3
setuptools     56.2.0
six            1.16.0
toml           0.10.2
tqdm           4.60.0
wheel          0.36.2

So I might as well go and remove that in pyhf as well.

matthewfeickert added a commit to scikit-hep/pyhf that referenced this issue May 13, 2021
* Remove global exclude of dotfiles from MANIFEST.in to avoid potential problems with build systems
   - c.f. scikit-build/scikit-build#537
* Use `prune **` to remove all files from the sdist
   - c.f. https://packaging.python.org/guides/using-manifest-in/#manifest-in-commands
   - "Setuptools also has undocumented support for ** matching zero or more characters including forward slash, backslash, and colon."
* Manually include all "default" files for a sdist in MANIFEST.in
   - c.f. https://packaging.python.org/guides/using-manifest-in/#how-files-are-included-in-an-sdist
* Include AUTHORS in MANIFEST.in
* Add list of sdist contents to package publishing CI
   - Allow for easier checking of the sdist contents in CI logs
@henryiii
Copy link
Contributor

henryiii commented Jun 8, 2021

I think this might help: #402

matthewfeickert added a commit to matthewfeickert/heputils that referenced this issue Aug 5, 2021
* Remove global exclude of dotfiles from MANIFEST.in to avoid potential problems with build systems
   - c.f. scikit-build/scikit-build#537
* Use `prune **` to remove all files from the sdist
   - c.f. https://packaging.python.org/guides/using-manifest-in/#manifest-in-commands
   - "Setuptools also has undocumented support for ** matching zero or more characters including forward slash, backslash, and colon."
* Manually include all "default" files for a sdist in MANIFEST.in
   - c.f. https://packaging.python.org/guides/using-manifest-in/#how-files-are-included-in-an-sdist
* Add list of sdist contents to package publishing CI
   - Allow for easier checking of the sdist contents in CI logs
matthewfeickert added a commit to eschanet/simplify that referenced this issue Nov 9, 2021
* Remove global exclude of dotfiles from MANIFEST.in to avoid potential problems with build systems
   - c.f. scikit-build/scikit-build#537
* Use `prune **` to remove all files from the sdist
   - c.f. https://packaging.python.org/guides/using-manifest-in/#manifest-in-commands
   - "Setuptools also has undocumented support for ** matching zero or more characters including forward slash, backslash, and colon."
* Manually include all "default" files for a sdist in MANIFEST.in
   - c.f. https://packaging.python.org/guides/using-manifest-in/#how-files-are-included-in-an-sdist
* Add list of sdist and wheel contents to package publishing CI
   - Allow for easier checking of the sdist and wheel contents in CI logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants