-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] Selection of package data in sdist and wheels with include-package-data
keyword
#4638
Comments
Hi @DanielYang59 please note that if you want This condition is documented in https://setuptools.pypa.io/en/latest/userguide/datafiles.html#include-package-data:
What The likely reason why the sdist on PyPI have the files is because you are using
I believe |
Hi @abravalheri thanks a loooooooooot for your quick response and the information (I should have read the documentation more carefully). I could confirm using the following includes everything (seemingly, and I would need a closer inspection later) inside the
For some reason sometimes changes in Thanks again! |
Hi @abravalheri thanks again for the comprehensive reply. I went through the Data Files Support page again and there're several points that are still not fully clear to me (bear with me for the newbie questions). Usage of
|
Update: I think I understand now. Just created a demo package: demo_project.zip
And looks like
In other words, if the If I understand correctly,
And I don't think the following is quite right? i.e.
|
include-package-data
keyword
Assuming that you put a |
This is how these conditions work togheter (in terms of Boolean expressions): Notation:
s = m + e'.p
w = i.e'.m + e'.p -- Which can be simplified => e' . (i.m + p)
-- and is also equivalent to => e' . (i.s + p)
This behaviour is stable since v58.5.3, there is an experiment here showing those results https://github.com/abravalheri/experiment-setuptools-package-data?tab=readme-ov-file#results-for-setuptools6060. |
I could confirm it's right! i.e. with no
But I have a feeling that this is not clear from the documentation? Perhaps it's best to update that?
Thanks for sharing! I must have seen this while searching in |
Definitely. Would you like to propose a PR for that? |
With pleasure, I would open a PR for that soon.
Fully understandable, perhaps it good for a newcomer (me) to play a part such that other new users could easily understand too, because as a newcomer it's clearer to me what might be missing from the docs. Any thanks a ton for the detailed explanation and examples again! |
I really appreciate this, which makes everything very clear and should be included into the docs (I believe). One minor comment though (I could be missing some background here), as "include or not" is a binary logic, can we use the standard logical connectives instead of creating definition ourselves? It was a bit hard to read, and defining
|
There are many popular notations for Boolean Algebra. I found this article that seems to summarise the main ones: https://www.allaboutcircuits.com/technical-articles/boolean-basics/. The notion of a "standard" notation in this scenario may be biased by personal experience or field of study. |
Thanks a lot for the input, yes I thought there could be background that I'm not aware of :)
|
setuptools version
setuptools==74.1.2
Python version
Python 3.12.5 (MacOS) Python 3.10.12 (Ubuntu-WSL2)
OS
MacOS Sonoma 14.6.1 and Ubuntu-WSL2 22.04 LTS
Additional environment information
Well I haven't installed
setuptools
on my fridge (yet), maybe laterDescription
I was trying to replace explicit declare of package data with
include-package-data = true
forpymatgen
, but noticedpython3 -m build
could generate source distribution with package data missing (even after I removeddist
andsrc/pymatgen.egg-info
). I believe no other files were controlling this process (noMANIFEST.in
, no related args insetup.py
).Here's the related section in
pyproject.toml
file (this is the complete file):Expected behavior
I would expect
python3 -m build
to behave consistently and generate wheels and sdist exactly as specified inpyproject.toml
file.The generated wheel (the wheel on pypi for example) and sdist should include multiple package data files (json and more):
How to Reproduce
Inspect the source distribution:
Inspect the wheel:
Output
>>> python3 -m build
Output as file (too many lines): build.log
Generated sdist (all *.json, *.csv, *.yaml...missing):
pymatgen-2024.8.9.tar.gz
The same to the wheel (cannot upload as
.whl
is not supported).The text was updated successfully, but these errors were encountered: