-
-
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] [options.package_data]
in setup.cfg does nothing
#2710
Comments
I've solved this today by REMOVING
|
This is related to/caused by #1461. |
Just a note: currently it does not work without
Commands:
dist/mypackage-0.0.1.tar.gz does not contain TESTFILE.md :( |
Hi @psarka, could you show us how your file tree looks like? Please note that If you want to avoid using |
Ah, I see, I missed that the files have to be in the package folder. I'll stick to Just in case, my tree is just these three files:
|
Sorry if that is confusing in the docs: https://setuptools.pypa.io/en/latest/userguide/datafiles.html Both |
Hi @greyltc, I think this issue has been solved in #2844, and should already be fixed in the latest version of setuptools. I tried to reproduce the problems with the commands bellow, and everything seems to be fine: $ git clone https://gitlab.com/greyltc/runpanel.git
$ cd runpanel
$ virtualenv .venv
$ .venv/bin/python -m pip install buil
$ .venv/bin/python -m build
$ tar tf dist/runpanel-0.0.1.tar.gz
runpanel-0.0.1/
runpanel-0.0.1/LICENSE
runpanel-0.0.1/PKG-INFO
runpanel-0.0.1/README.md
runpanel-0.0.1/data/
runpanel-0.0.1/data/config_stubs/
runpanel-0.0.1/data/config_stubs/badger.yaml
runpanel-0.0.1/data/config_stubs/do_virt.yaml
runpanel-0.0.1/data/config_stubs/otter.yaml
runpanel-0.0.1/data/runpanel.desktop
runpanel-0.0.1/data/runpanel.svg
runpanel-0.0.1/pyproject.toml
runpanel-0.0.1/setup.cfg
runpanel-0.0.1/setup.py
runpanel-0.0.1/src/
runpanel-0.0.1/src/runpanel/
runpanel-0.0.1/src/runpanel/__init__.py
runpanel-0.0.1/src/runpanel/__main__.py
runpanel-0.0.1/src/runpanel/app.py
runpanel-0.0.1/src/runpanel/sysdbus.py
runpanel-0.0.1/src/runpanel/system_config.yaml
runpanel-0.0.1/src/runpanel/ui.glade
runpanel-0.0.1/src/runpanel.egg-info/
runpanel-0.0.1/src/runpanel.egg-info/PKG-INFO
runpanel-0.0.1/src/runpanel.egg-info/SOURCES.txt
runpanel-0.0.1/src/runpanel.egg-info/dependency_links.txt
runpanel-0.0.1/src/runpanel.egg-info/entry_points.txt
runpanel-0.0.1/src/runpanel.egg-info/requires.txt
runpanel-0.0.1/src/runpanel.egg-info/top_level.txt
$ unzip -l dist/runpanel-0.0.1-py3-none-any.whl
Archive: dist/runpanel-0.0.1-py3-none-any.whl
Length Date Time Name
--------- ---------- ----- ----
0 2022-01-17 13:41 runpanel/__init__.py
164 2022-01-17 13:41 runpanel/__main__.py
131069 2022-01-17 13:41 runpanel/app.py
3472 2022-01-17 13:41 runpanel/sysdbus.py
19470 2022-01-17 13:41 runpanel/system_config.yaml
255696 2022-01-17 13:41 runpanel/ui.glade
684 2022-01-17 13:41 runpanel-0.0.1.data/data/share/applications/runpanel.desktop
9706 2022-01-17 13:41 runpanel-0.0.1.data/data/share/icons/runpanel.svg
2757 2022-01-17 13:41 runpanel-0.0.1.data/data/share/runpanel/configs/badger.yaml
201 2022-01-17 13:41 runpanel-0.0.1.data/data/share/runpanel/configs/do_virt.yaml
4095 2022-01-17 13:41 runpanel-0.0.1.data/data/share/runpanel/configs/otter.yaml
19470 2022-01-17 13:41 runpanel-0.0.1.data/data/share/runpanel/configs/system_config.yaml
35149 2022-01-17 13:55 runpanel-0.0.1.dist-info/LICENSE
460 2022-01-17 13:55 runpanel-0.0.1.dist-info/METADATA
92 2022-01-17 13:55 runpanel-0.0.1.dist-info/WHEEL
59 2022-01-17 13:55 runpanel-0.0.1.dist-info/entry_points.txt
9 2022-01-17 13:55 runpanel-0.0.1.dist-info/top_level.txt
1640 2022-01-17 13:55 runpanel-0.0.1.dist-info/RECORD
--------- -------
484193 18 files
$ .venv/bin/python -m pip install --no-deps dist/runpanel-0.0.1-py3-none-any.whl
$ cd tests
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib.resources
>>> list(importlib.resources.contents('runpanel'))
['app.py', 'sysdbus.py', 'system_config.yaml', 'ui.glade', '__init__.py', '__main__.py', '__pycache__'] Please let me know if there is any problem left, otherwise we can close this issue. |
I can't quite tell what was fixed, or if the docs were updated or not, but by way of another data point:
[options.package_data]
* = include/* And it worked: my files are included in What did not seem to make any difference, inasmuch as if I only used these things it didn't help, and if I left them out it didn't matter:
So I don't have either of those two things. This situation does not seem to match the docs you linked to but those don't really talk about I'm on Python 3.9.7 and |
Hi @kwinkunks thank you very much for the feedback.
If you are specifying all the non-Python files with
Are there specific parts of that page that need updating or are incorrect? |
Thank you very much for this explanation, and thanks for everything you're doing to make packaging easier. Re the docs, at the top of the page it says this:
But that did not work for me. The only thing that worked, and it worked on its own (without either I am using only I need to look at |
Thank you for the kind words and for the feedback @kwinkunks. I will try to propose a change in the docs soon (I have to admit I managed to accumulate quite a few TODOs for my open source projects this week, so I might take some time, please feel free to submit a doc PR meanwhile!). Since I fixed the previous issue, I keep a benchmark for this class of problems in https://github.com/abravalheri/experiment-setuptools-package-data: I will re-run it with the most updated version of Any chance you are running UPDATE: I re-run the experiment for |
All good -- that table is gold. Thank you very much! (I was on v58.0.4, now updated.) |
I think I will close this issue for now... Any PR for improve the docs would also be appreciated! |
setuptools version
57.0.0
Python version
3.9.5
OS
Arch
Additional environment information
No response
Description
I have this project: https://gitlab.com/greyltc/runpanel/-/tree/a93fac114f5443dc5ae55b9a8eb395b3244e282b
It has a setup.cfg file with
and
As you can see from the repo there, there's a
system_config.yaml
file present that I expect to be included as package data. But after I install the package, and runI get only
['__pycache__', '__init__.py', '__main__.py', 'app.py', 'sysdbus.py']
. There's no yaml file.Expected behavior
I expect that when I follow the packaging docs for including package_data files here: https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html?highlight=package_data
that data should make it into my package.
How to Reproduce
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: