-
Notifications
You must be signed in to change notification settings - Fork 11
/
DEVREADME
44 lines (39 loc) · 2.3 KB
/
DEVREADME
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# ====================================================================================== #
# Troubleshooting notes.
# Author: Eddie Lee, edlee@santafe.edu
# ====================================================================================== #
Notes for how to compile for PyPI
---------------------------------
- In your project, create a folder for your Python module. Other setup files will go in
the directory above that folder.
- Write setup.py with options to specify compile options. Can use either
distutils.core.setup or setuptools.setup (latter is supposed to be more user friendly).
- Delete the dist and build directories.
- Compile module with `python setup.py bdist_wheel` This will create a dist folder in the
folder that will be uploaded.
- For Linux distributions, the wheel must be renamed to be for manylinux1 as in
PACKAGE-VERSION-cp27-cp27mu-manylinux1_x86_64.whl
- Upload to PyPI test server `twine upload --repository testpypi dist/*`
- Install it with `pip install --index-url https://test.pypi.org/simple/ your-package`
Make sure you change out of the project direcotry otherwise pip will think the project
is already installed because it's currently in your path.
- Once the project has been tested, upload to PyPI test server `twine upload --repository
pypi dist/*`
- Settings are saved in ~/.pypirc
Refs
----
https://setuptools.readthedocs.io/en/latest/setuptools.html#including-data-files
Notes on Boost extension
------------------------
- Boost library for python and numpy must be on both LIBRARY_PATH and LD_LIBRARY_PATH for
module to function. The former is used by gcc for compilation and the latter is used by
your program after it has been compiled.
- For compilation, these libraries must also be included in CPLUS_INCLUDE_PATH. While
including the path to the anaconda environment include directory should work, setting this
env variable explicitly is also a solution.
- Header files paths (e.g., "boost/python/numpy.hpp") must be on include path variable.
These might need to be specified additionally in the include_dirs argument in setup.py
if the bash environment is not set up properly.
- If you see an ld error, there is a problem with linking the dynamic libraries that
should be on your system. Copy the g++ call and add the "-v" flag to see what is
happening in detail.