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

move package_data and data_files to an Additional Topic #178

Open
qwcode opened this issue Oct 17, 2015 · 3 comments
Open

move package_data and data_files to an Additional Topic #178

qwcode opened this issue Oct 17, 2015 · 3 comments

Comments

@qwcode
Copy link
Contributor

qwcode commented Oct 17, 2015

move package_data and data_files to an Additional Topic

in the main distribution tutorial, just use MANIFEST.in and include_package_data

pypa/sampleproject#30 (comment)

@nchammas
Copy link

nchammas commented Dec 8, 2015

➕ 9️⃣ 0️⃣ 0️⃣ 0️⃣ for this.

I just spent a good few hours reading various posts on Stack Overflow and experimenting unsuccessfully with my setup.py to try to get it to package my data files correctly. 🙅

Using MANIFEST.in and include_package_data to the exclusion of package_data and data_files is definitely more straightforward and got me what I wanted very quickly.

I would also link to the MANIFEST.in command syntax so people can find it easily from the guide.

@nchammas
Copy link

Hmm, actually I'm not totally getting what I expect from MANIFEST.in and include_package_data.

This is what I have:

project/
    module/
        __init__.py
        project.py
        script.sh
    tests/
        test_errrrrthang.py
    random-file
    MANIFEST.in
    setup.py

If I include everything inside project/ in my MANIFEST.in, then it all gets packaged by python3 setup.py sdist into a .tar.gz. This is good. Without the MANIFEST.in, only the Python files in module/ get packaged by sdist; script.sh and everything outside of module/ are left out. This is also good.

Well, maybe not good, but at least so far I think this behavior is well-documented.

However, if I try to pip install that source distribution into a new venv, I only get the contents of module/. tests/ and random-file are nowhere to be found in the venv, even though they are in the source distribution. The same thing happens if I install from a wheel generated by bdist_wheel.

Is this expected? I'm running Python 3.5.1, pip 7.1.2, setuptools 18.2, and wheel 0.26.0.

Luckily in my case, I can rearrange stuff so that it all gets installed by putting random-file and even tests/ inside of module/.

But what is the advice we want to give people who don't necessarily want to do this?

"This will not be supported going forward" is totally an OK answer, by the way. I think the issue I'm raising here has already been discussed extensively over on pypa/pip#2874, and I think that's what @dstufft was getting at over there. Is that right?

@nchammas
Copy link

And for the record @dstufft, the explanation of your rationale and vision in these two comments was very enlightening. Thank you for writing those up. As a new Python packaging user, I'm optimistic about the direction we're going in.

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

2 participants