Skip to content

Commit 8f606d5

Browse files
committed
Fix many issues in deployment process
* Fix conflicting folder name between python package and fcl dependency * Move to `src/module` tree schema * Fix `setup.cfg` options * Merge clone and build bash scripts for clarity (future mac/win builds)
1 parent 158e3c9 commit 8f606d5

17 files changed

Lines changed: 134 additions & 73 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ wheels/
2525
.installed.cfg
2626
*.egg
2727
MANIFEST
28+
deps/
2829

2930
# PyInstaller
3031
# Usually these files are written by a python script from a template

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
mkdir -p deps
2+
cd deps
3+
get eigen
4+
curl -OL https://gitlab.com/libeigen/eigen/-/archive/3.3.9/eigen-3.3.9.tar.gz
5+
tar -zxf eigen-3.3.9.tar.gz
6+
7+
rm -rf libccd
8+
git clone --depth 1 --branch v2.1 https://github.com/danfis/libccd.git
9+
10+
rm -rf octomap
11+
git clone --depth 1 --branch v1.8.0 https://github.com/OctoMap/octomap.git
12+
13+
rm -rf fcl
14+
git clone --depth 1 --branch v0.6.1 https://github.com/flexible-collision-library/fcl.git
15+
16+
echo "Install eigen"
17+
cmake -B build -S eigen-3.3.9
18+
cmake --install build
19+
20+
echo "Build and install libccd"
21+
cd libccd
22+
cmake .
23+
make -j4
24+
make install
25+
cd ..
26+
27+
echo "Build and install octomap"
28+
cd octomap
29+
cmake .
30+
make -j4
31+
make install
32+
cd ..
33+
34+
echo "Build and install fcl"
35+
cd fcl
36+
cmake .
37+
make -j4
38+
make install
39+
cd ..
40+
41+
cd ..

fcl/__init__.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools", "wheel", "numpy", "Cython"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.cibuildwheel]
6-
before-all = "bash requirements/clone.bash && bash requirements/build.bash"
6+
before-all = "bash build_dependencies/install_linux.sh"
77
before-build = "pip install numpy cython"
88
manylinux-x86_64-image = "manylinux_2_24"
99
test-requires = "pytest"

requirements/build.bash

Lines changed: 0 additions & 24 deletions
This file was deleted.

requirements/clone.bash

Lines changed: 0 additions & 12 deletions
This file was deleted.

setup.cfg

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,21 @@ classifiers =
2424
Programming Language :: Python :: 3.5
2525
Programming Language :: Python :: 3.6
2626
keywords = fcl collision distance
27-
packages = fcl
27+
28+
[options]
29+
include_package_data = True
30+
package_dir =
31+
= src
32+
packages = find:
2833
setup_requires =
2934
numpy
3035
Cython
3136
install_requires =
3237
numpy
3338
Cython
39+
40+
[options.package_data]
41+
* = *.pyx, *.pxd
42+
43+
[options.packages.find]
44+
where = src

setup.py

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22
import sys
33

44
from setuptools import Extension, setup
5+
from Cython.Build import cythonize
56

67

78
def get_include_dirs():
89
platform_supported = False
9-
for prefix in ['darwin', 'linux', 'bsd']:
10+
for prefix in ["darwin", "linux", "bsd"]:
1011
if prefix in sys.platform:
1112
platform_supported = True
12-
include_dirs = ['/usr/include',
13-
'/usr/local/include',
14-
'/usr/include/eigen3',
15-
'/usr/local/include/eigen3']
16-
17-
if 'CPATH' in os.environ:
18-
include_dirs += os.environ['CPATH'].split(':')
13+
include_dirs = [
14+
"/usr/include",
15+
"/usr/local/include",
16+
"/usr/include/eigen3",
17+
"/usr/local/include/eigen3",
18+
]
19+
20+
if "CPATH" in os.environ:
21+
include_dirs += os.environ["CPATH"].split(":")
1922

2023
break
2124
if sys.platform == "win32":
@@ -25,32 +28,35 @@ def get_include_dirs():
2528

2629
# get the numpy include path from numpy
2730
import numpy
31+
2832
include_dirs.append(numpy.get_include())
2933
return include_dirs
3034

35+
3136
def get_libraries_dir():
32-
for prefix in ['darwin', 'linux', 'bsd']:
37+
for prefix in ["darwin", "linux", "bsd"]:
3338
if prefix in sys.platform:
3439
platform_supported = True
35-
lib_dirs = ['/usr/lib',
36-
'/usr/local/lib']
37-
38-
if 'LD_LIBRARY_PATH' in os.environ:
39-
lib_dirs += os.environ['LD_LIBRARY_PATH'].split(':')
40+
lib_dirs = ["/usr/lib", "/usr/local/lib"]
41+
42+
if "LD_LIBRARY_PATH" in os.environ:
43+
lib_dirs += os.environ["LD_LIBRARY_PATH"].split(":")
4044
return lib_dirs
4145
raise NotImplementedError(sys.platform)
4246

4347

4448
setup(
45-
ext_modules=[Extension(
46-
"fcl.fcl",
47-
["fcl/fcl.pyx"],
48-
include_dirs = get_include_dirs(),
49-
library_dirs = get_libraries_dir(),
50-
libraries=[
51-
"fcl","octomap"
52-
],
53-
language="c++",
54-
extra_compile_args = ["-std=c++11"]
55-
)]
49+
ext_modules=cythonize(
50+
[
51+
Extension(
52+
"fcl.fcl",
53+
["src/fcl/fcl.pyx"],
54+
include_dirs=get_include_dirs(),
55+
library_dirs=get_libraries_dir(),
56+
libraries=["fcl", "octomap"],
57+
language="c++",
58+
extra_compile_args=["-std=c++11"],
59+
)
60+
],
61+
)
5662
)

0 commit comments

Comments
 (0)