iory / pySDFGen

SDFGen for Python
8 stars 2 forks source link

Fix setup.py and MANIFEST so that it include source code #17

Closed HiroIshida closed 2 years ago

HiroIshida commented 2 years ago

Description

Originally, pysdfgen seems not correctly packaging the source code and CMakeLists.txt when doting python3 setup.py sdist. (I'm not sure why it was working well until recently, but maybe setuptools changes behavior recently ?? .. ) Because of this, although pysdfgen==0.1.6 can be installed via pip, the package does not contain any SDFGen's binary... I noticed this bug when I made a tiny typo-fix PR in scikit-robot and it failed. https://github.com/iory/scikit-robot/pull/254

WHat I changed

But, in any case, to my understanding according to https://python-packaging.readthedocs.io/en/latest/non-code-files.html we should make some change. First we must add include_package_data=True in setup.py parameter Second, we must add include keyword in the MANIFEST (or MANIFEST.in) file. (e.g. in MANIFEST.in file in opencv-python https://github.com/opencv/opencv-python/blob/4.x/MANIFEST.in ) Third: rename MANIFEST => MANIFEST.in

my environment

h-ishida@stonep:~/python/pySDFGen/dist$ python3 -m pip --version pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

Before

h-ishida@stonep:~/python/pySDFGen$ python3 setup.py sdist --quiet && cd dist && tar xf * && tree

running sdist
running generate_source_manifest
running egg_info
creating pysdfgen.egg-info
writing pysdfgen.egg-info/PKG-INFO
writing dependency_links to pysdfgen.egg-info/dependency_links.txt
writing requirements to pysdfgen.egg-info/requires.txt
writing top-level names to pysdfgen.egg-info/top_level.txt
writing manifest file 'pysdfgen.egg-info/SOURCES.txt'
reading manifest file 'pysdfgen.egg-info/SOURCES.txt'
writing manifest file 'pysdfgen.egg-info/SOURCES.txt'
running check
creating pysdfgen-0.1.6
creating pysdfgen-0.1.6/pysdfgen
creating pysdfgen-0.1.6/pysdfgen.egg-info
copying files to pysdfgen-0.1.6...
copying README.md -> pysdfgen-0.1.6
copying setup.cfg -> pysdfgen-0.1.6
copying setup.py -> pysdfgen-0.1.6
copying pysdfgen/__init__.py -> pysdfgen-0.1.6/pysdfgen
copying pysdfgen.egg-info/PKG-INFO -> pysdfgen-0.1.6/pysdfgen.egg-info
copying pysdfgen.egg-info/SOURCES.txt -> pysdfgen-0.1.6/pysdfgen.egg-info
copying pysdfgen.egg-info/dependency_links.txt -> pysdfgen-0.1.6/pysdfgen.egg-info
copying pysdfgen.egg-info/requires.txt -> pysdfgen-0.1.6/pysdfgen.egg-info
copying pysdfgen.egg-info/top_level.txt -> pysdfgen-0.1.6/pysdfgen.egg-info
Writing pysdfgen-0.1.6/setup.cfg
copied 10 files
creating 'dist/pysdfgen-0.1.6' gztar archive and adding 'pysdfgen-0.1.6' to it
creating dist
Creating tar archive
removing 'pysdfgen-0.1.6' (and everything under it)
pysdfgen-0.1.6.tar.gz
.
├── pysdfgen-0.1.6
│   ├── PKG-INFO
│   ├── pysdfgen
│   │   └── __init__.py
│   ├── pysdfgen.egg-info
│   │   ├── dependency_links.txt
│   │   ├── PKG-INFO
│   │   ├── requires.txt
│   │   ├── SOURCES.txt
│   │   └── top_level.txt
│   ├── README.md
│   ├── setup.cfg
│   └── setup.py
└── pysdfgen-0.1.6.tar.gz

3 directories, 11 files

After

h-ishida@stonep:~/python/pySDFGen$ python3 setup.py sdist --quiet && cd dist && tar xf * && tree
running sdist
running generate_source_manifest
running egg_info
creating pysdfgen.egg-info
writing pysdfgen.egg-info/PKG-INFO
writing dependency_links to pysdfgen.egg-info/dependency_links.txt
writing requirements to pysdfgen.egg-info/requires.txt
writing top-level names to pysdfgen.egg-info/top_level.txt
writing manifest file 'pysdfgen.egg-info/SOURCES.txt'
reading manifest file 'pysdfgen.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.travis.yml'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'SDFGen/README.md'
warning: no files found matching 'SDFGen/config.h.in'
writing manifest file 'pysdfgen.egg-info/SOURCES.txt'
running check
creating pysdfgen-0.1.6
creating pysdfgen-0.1.6/SDFGen
creating pysdfgen-0.1.6/pysdfgen
creating pysdfgen-0.1.6/pysdfgen.egg-info
copying files to pysdfgen-0.1.6...
copying .gitignore -> pysdfgen-0.1.6
copying .gitmodules -> pysdfgen-0.1.6
copying CMakeLists.txt -> pysdfgen-0.1.6
copying MANIFEST.in -> pysdfgen-0.1.6
copying README.md -> pysdfgen-0.1.6
copying setup.cfg -> pysdfgen-0.1.6
copying setup.py -> pysdfgen-0.1.6
copying SDFGen/CMakeLists.txt -> pysdfgen-0.1.6/SDFGen
copying SDFGen/array1.h -> pysdfgen-0.1.6/SDFGen
copying SDFGen/array2.h -> pysdfgen-0.1.6/SDFGen
copying SDFGen/array3.h -> pysdfgen-0.1.6/SDFGen
copying SDFGen/hashgrid.h -> pysdfgen-0.1.6/SDFGen
copying SDFGen/hashtable.h -> pysdfgen-0.1.6/SDFGen
copying SDFGen/main.cpp -> pysdfgen-0.1.6/SDFGen
copying SDFGen/makelevelset3.cpp -> pysdfgen-0.1.6/SDFGen
copying SDFGen/makelevelset3.h -> pysdfgen-0.1.6/SDFGen
copying SDFGen/util.h -> pysdfgen-0.1.6/SDFGen
copying SDFGen/vec.h -> pysdfgen-0.1.6/SDFGen
copying pysdfgen/__init__.py -> pysdfgen-0.1.6/pysdfgen
copying pysdfgen.egg-info/PKG-INFO -> pysdfgen-0.1.6/pysdfgen.egg-info
copying pysdfgen.egg-info/SOURCES.txt -> pysdfgen-0.1.6/pysdfgen.egg-info
copying pysdfgen.egg-info/dependency_links.txt -> pysdfgen-0.1.6/pysdfgen.egg-info
copying pysdfgen.egg-info/requires.txt -> pysdfgen-0.1.6/pysdfgen.egg-info
copying pysdfgen.egg-info/top_level.txt -> pysdfgen-0.1.6/pysdfgen.egg-info
Writing pysdfgen-0.1.6/setup.cfg
copied 25 files
creating 'dist/pysdfgen-0.1.6' gztar archive and adding 'pysdfgen-0.1.6' to it
creating dist
Creating tar archive
removing 'pysdfgen-0.1.6' (and everything under it)
pysdfgen-0.1.6.tar.gz
.
├── pysdfgen-0.1.6
│   ├── CMakeLists.txt
│   ├── MANIFEST.in
│   ├── PKG-INFO
│   ├── pysdfgen
│   │   └── __init__.py
│   ├── pysdfgen.egg-info
│   │   ├── dependency_links.txt
│   │   ├── PKG-INFO
│   │   ├── requires.txt
│   │   ├── SOURCES.txt
│   │   └── top_level.txt
│   ├── README.md
│   ├── SDFGen
│   │   ├── array1.h
│   │   ├── array2.h
│   │   ├── array3.h
│   │   ├── CMakeLists.txt
│   │   ├── hashgrid.h
│   │   ├── hashtable.h
│   │   ├── main.cpp
│   │   ├── makelevelset3.cpp
│   │   ├── makelevelset3.h
│   │   ├── util.h
│   │   └── vec.h
│   ├── setup.cfg
│   └── setup.py
└── pysdfgen-0.1.6.tar.gz

4 directories, 24 files
iory commented 2 years ago

LGTM!

iory commented 2 years ago

Released 0.1.7. Thanks!