Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python setup.py build ignoring some files

Tags:

I have the following structure for my Python package:

$ tree -d | grep -v "__pycache__"
.
├── src
│   ├── poliastro
│   │   ├── iod
│   │   ├── tests
│   │   └── twobody
│   │       └── tests
├── setup.py
└── MANIFEST.in

47 directories

Buf after performing python setup.py build, the innermost test directory is not getting copied:

$ tree -d | grep -v "__pycache__"
.
├── build
│   ├── lib
│   │   └── poliastro
│   │       ├── iod
│   │       ├── tests
│   │       └── twobody

On the contrary, python setup.py sdist works correctly.

So far I've used the MANIFEST.in rules to include or exclude certain files, patterns and directories from the sdist. Is there a way to control what goes to the build directory? Why some tests are getting there and some others aren't?

Reference to original issue and source code: https://github.com/poliastro/poliastro/issues/129

like image 358
astrojuanlu Avatar asked Jul 14 '16 21:07

astrojuanlu


2 Answers

Your setup() is missing include_package_data=True. See this PR I have made https://github.com/poliastro/poliastro/pull/139

Discussion: Without this, non-python package files (such as the test py files you list that are not "in a package") are not included by default, even though they are technically part of an otherwise included Python package directory tree.
/HTH

like image 198
Philippe Ombredanne Avatar answered Sep 28 '22 03:09

Philippe Ombredanne


Try putting __init__.py files inside the included folders specified in MANIFEST.in.

like image 27
ecolell Avatar answered Sep 28 '22 03:09

ecolell