-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
neither package_data or data_files get installed #30
Comments
can you provide details with a paste of your output |
ok, I see. it works when installing (using pip or easy_install) from a built sdist, but not using "python setup.py install" from a checkout. I wasn't aware. will look into it. |
I think this is related to @ericfrederich issue? Test 1) If I do Test 2) I create a wheel using Test 3) But when I create a sdist (
Test 4) Now if I remove package_data.dat from MANIFEST.in, it only includes the package_data as I would have expected...I guess when creating an sdist, these files are ALWAYS added even after python 2.6 due to MANIFEST.in I guess this is all related to the same problem that's been plaguing sdist vs bdist forever http://blog.codekills.net/2011/07/15/lies,-more-lies-and-python-packaging-documentation-on--package_data-/ Although I don't know how much of that is still accurate or translates to setuptools, but I DO know the same problems appear to be happening...It's just this sample doesn't appear to work for both... YET? Python 2.7.9 Windows 64-bit and Linux 64-Bit |
Neither [1] If you have the patience watch this |
yea @ionelmc , I think the sample project and the distribution tutorial needs some rehaul in this department. just recommend the easiest thing (like in your video), and maybe have an advanced section to cover all the caveats etc... that are so hard to remember. |
Using |
@ionelmc what is the way to include some data with a project, that will get installed into the virtualenv (and allow installation using pip) ? |
@stuaxo |
Ah, was messing with this too late and had broken my MANIFEST.in.
Cheers for the pointer.
|
@ionelmc |
OT: Setuptools is such a mess, and the defaults mean I have to look up how to do this every year or so. I'm glad work is being done on it, but having delved inside, I think we'd be better off chucking it out and using something else at this point. |
When will this be fixed. You are justing wasting others' time, which is a kind of murder! |
@fduxiao it's funny, as I only package something about once a year, I always, without fail - forget how to add non .py files to my python package, python packaging is almost always painful in some way. |
@stuaxo In my situation, I use cython to accelerate my web application, which requires non python templates and will be used further by other projects, and I found the only way that works is putting an empty init.py into the templates dir and tell cython not to handle it (they are found automatically). It cost me more then 3 hours to find it. |
@fduxiao is the workaround of |
@nicktimko See my fork here. I'm not sure whether I write the |
Saying StackOverflow might be a better forum for such a question than here. |
@nicktimko It never works if my package has only compile modules (You see I just cythonized the modules and the data just fail to be installed). The conclusion I can get from stackoverflow is that it's only a dirty lie. I'm not asking a question. I'm saying one could not put package data for a package of compile modules. It may be caused by the fact that |
@fduxiao I had to do the thing with a fake |
Hello all, Yesterday for the first time I faced a need to create a Python package. I didn't think it would be such a pain if it's supposed to have data files! I've skimmed through the documentation, but it's so diverse and inaccurate that I can't wrap my head around it. I set up a simple directory structure:
The contents of
The
When I do What am I doing wrong? Any help is appreciated. Thank you. PS: Have watched @ionelmc 's presentation and tried the following |
@andreypanin |
Is this problem solved? I can use Python 3.7.3 64bit |
I'm gonna go ahead and close this -- packagers should use You can look at the pip's setup.py and MANIFEST.in for a more concrete example. If anyone has similar/other issues related to which files get included, please check if there's a related issue filed on setuptools' issue tracker, otherwise please file a new issue there. :) Thanks everyone for chiming in here! |
To be clear, using a different build tool like flit can help avoid these setuptools specific issues. |
With Python 3 I've found out that the MANIFEST.in is not honored anymore in the wheel, but it is in the tar.gz! Maybe this was always the case but I just noticed now. Anyway, here is the fix: to force the wheel to honor the MANIFEST.in, you need to specify both If your Python module is inside a folder "mymodule", here is how the setup looks like:
If all your python scripts are at the root (and not inside a subfolder), use:
|
because src/vak/config/valid.toml was not being included in the source distribution -- not clear why it is not working (anymore?) -- but that was the only reason to have it will use a MANIFEST.in instead -- tested and that does work using MANIFEST.in seems to be best practice. See: - http://blog.codekills.net/2011/07/15/lies,-more-lies-and-python-packaging-documentation-on--package_data-/ - pypa/sampleproject#30 - https://youtu.be/o-UbWsO9rZk?t=695
I have tried this on Python 2.7.5 and Python 3.4.3 and am unable to see package_data.dat or data_file installed anywhere when I do "python setup.py install"
If I change to distutils it works fine.
The text was updated successfully, but these errors were encountered: