Skip to content

Commit

Permalink
fix bdist-wheel command to build manylinux wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerGubala committed Oct 20, 2020
1 parent ec57368 commit 3928714
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
"command": "docker-compose",
"args": [
"up",
"--build",
"blenderpy-manylinux-wheel-builder"
],
"problemMatcher": []
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks/Docker/manylinux/build_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function repair_wheel {
for PYBIN in /opt/python/cp37*/bin; do
# to install, uncomment the below line
# "${PYBIN}/pip" install /blenderpy --global-option="build_ext" --global-option="--builtbpy=/build/linux/bin/" -v
"${PYBIN}/pip" wheel /blenderpy --build-option="--builtbpy=/build/linux/bin/" -v -w wheelhouse/
"${PYBIN}/pip" wheel /blenderpy --build-option="--builtbpy=/build/linux/bin/" --no-deps -v -w wheelhouse/
done

# Bundle external shared libraries into the wheels
Expand Down
19 changes: 11 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import platform
import re
from setuptools import find_packages, setup, Extension
from setuptools.command.build_py import build_py
from setuptools.command.build_ext import build_ext
from setuptools.command.install import install
from setuptools.command.install_lib import install_lib
Expand All @@ -20,6 +19,7 @@
import struct
import sys
from typing import List, Set
from wheel.bdist_wheel import bdist_wheel

# Monkey-patch 3.4 and below

Expand Down Expand Up @@ -158,8 +158,10 @@ def run(self):

os.remove(dst_dir)

shutil.copy(scripts_dir,
os.path.join(self.build_dir,
# Copy the blender scripts directory

shutil.copytree(scripts_dir,
os.path.join(self.build_dir,
os.path.basename(scripts_dir)))

# Mark the scripts for installation, adding them to
Expand All @@ -170,11 +172,11 @@ def run(self):

super().run()

class CMakeBuild(build_py):
class CMakeBuild(bdist_wheel):
"""Create custom build
"""

user_options = build_py.user_options + [
user_options = bdist_wheel.user_options + [
("builtbpy=", None, "Location of prebuilt bpy binaries"),
("cuda", None, "Install with CUDA Cycles"),
("optix", None, "Install with Optix Cycles"),
Expand Down Expand Up @@ -221,7 +223,7 @@ def finalize_options(self):

super().finalize_options()

self.set_undefined_options('build_py',
self.set_undefined_options('bdist_wheel',
('builtbpy', 'builtbpy'),
('cuda', 'cuda'),
('optix', 'optix'),
Expand Down Expand Up @@ -399,13 +401,14 @@ def copy_bpy(self, source_path: pathlib.Path, dest_path: pathlib.Path):
install_requires=["numpy"],
url="https://github.com/TylerGubala/blenderpy",
cmdclass={
'build': CMakeBuild,
'bdist_wheel': CMakeBuild,
'build_ext': BuildCMakeExt,
'install_data': InstallCMakeLibsData,
'install_lib': InstallCMakeLibs,
'install_scripts': InstallBlenderScripts
},
setup_requires=[
"bpy-build"
"bpy-build",
"wheel"
]
)

0 comments on commit 3928714

Please sign in to comment.