-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build Python wheel #521
build Python wheel #521
Changes from all commits
13ae702
c2fd121
6e5d00b
42f8eb8
4705801
b9a05ed
c6bf6a6
347fc1c
777e228
3bab836
98fd929
493e2cd
43fd476
b3ede2a
28e085c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04, windows-latest, macos-latest] | ||
steps: | ||
- run: git config --global submodule.fetchJobs 8 | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Build wheels | ||
uses: pypa/cibuildwheel@v2.15.0 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: ./wheelhouse/*.whl | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
[project] | ||
name = "manifold3d" | ||
version = "2.2.0" | ||
authors = [ | ||
{ name="Emmett Lalish", email="elalish@gmail.com" }, | ||
] | ||
description = "Library for geometric robustness" | ||
readme = "README.md" | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: C++", | ||
"Topic :: Multimedia :: Graphics :: 3D Modeling", | ||
] | ||
requires-python = ">=3.7" | ||
|
||
dependencies = [ | ||
"numpy; python_version<'3.12'", | ||
"numpy>=1.26.0b1; python_version>='3.12'" | ||
] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/elalish/manifold" | ||
"Bug Tracker" = "https://github.com/elalish/manifold/issues" | ||
|
||
[build-system] | ||
requires = ["scikit-build-core", "pybind11"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[tool.scikit-build] | ||
cmake.minimum-version = "3.18" | ||
sdist.exclude = [ | ||
".github", | ||
"bindings/c", | ||
"bindings/wasm", | ||
"docs", | ||
"extras", | ||
"meshIO", | ||
"samples", | ||
"test", | ||
"oneTBB", # we may have this when we build with cibuildwheel | ||
"bindings/python/third_party/pybind11/tests/", | ||
"src/third_party/clipper2/CPP/Examples/", | ||
"src/third_party/clipper2/CPP/Tests/", | ||
"src/third_party/clipper2/CSharp/", | ||
"src/third_party/clipper2/Delphi/", | ||
"src/third_party/clipper2/DLL/", | ||
"src/third_party/clipper2/Tests/", | ||
"src/third_party/glm/doc/", | ||
"src/third_party/glm/test/", | ||
"src/third_party/thrust/dependencies/cub/", | ||
"src/third_party/thrust/dependencies/libcudacxx/.upstream-tests/", | ||
"src/third_party/thrust/dependencies/libcudacxx/docker/", | ||
"src/third_party/thrust/dependencies/libcudacxx/test/", | ||
"src/third_party/thrust/dependencies/libcudacxx/docs/", | ||
"src/third_party/thrust/dependencies/libcudacxx/libcxx/", | ||
"src/third_party/thrust/dependencies/libcudacxx/libcxxabi/", | ||
"src/third_party/thrust/dependencies/libcudacxx/libunwind/", | ||
"src/third_party/thrust/dependencies/libcudacxx/utils/google-benchmark/", | ||
"src/third_party/thrust/docs/", | ||
"src/third_party/thrust/testing/", | ||
"src/third_party/thrust/internal/test/", | ||
"src/third_party/thrust/examples/", | ||
"src/third_party/thrust/thrust/system/cuda", | ||
] | ||
wheel.packages = ["manifold3d"] | ||
cmake.args = ["-DMANIFOLD_PAR=TBB", "-DMANIFOLD_TEST=OFF"] | ||
install.components = ["bindings"] | ||
|
||
[tool.cibuildwheel] | ||
build-frontend = "build" | ||
test-requires = ["trimesh"] | ||
test-command = "python {project}/bindings/python/examples/run_all.py" | ||
# Setuptools bug causes collision between pypy and cpython artifacts | ||
manylinux-x86_64-image = "manylinux_2_28" | ||
musllinux-x86_64-image = "musllinux_1_2" | ||
skip = ["*-win32", "*_i686", "pp*", "*-musllinux*"] | ||
|
||
# only clone TBB once | ||
before-all = "git clone --depth 1 --branch v2021.10.0 https://github.com/oneapi-src/oneTBB.git" | ||
[tool.cibuildwheel.config-settings] | ||
"cmake.define.FETCHCONTENT_SOURCE_DIR_TBB" = "./oneTBB" | ||
"cmake.define.FETCHCONTENT_UPDATES_DISCONNECTED" = "ON" | ||
|
||
[tool.cibuildwheel.macos] | ||
archs = ["x86_64", "arm64"] | ||
environment = "MACOSX_DEPLOYMENT_TARGET=10.14" | ||
test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" | ||
|
||
[tool.cibuildwheel.windows] | ||
before-build = "pip install delvewheel" | ||
repair-wheel-command = "delvewheel repair -w {dest_dir} {wheel}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,7 +291,7 @@ std::shared_ptr<const PathImpl> CrossSection::GetPaths() const { | |
if (transform_ == glm::mat3x2(1.0f)) { | ||
return paths_; | ||
} | ||
paths_ = shared_paths(transform(paths_->paths_, transform_)); | ||
paths_ = shared_paths(::transform(paths_->paths_, transform_)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It search for the transform function defined in the anonymous namespace. By default it should search for the one in the current namespace, i.e. the transform function defined in par. |
||
transform_ = glm::mat3x2(1.0f); | ||
return paths_; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,6 @@ | |
|
||
#include "impl.h" | ||
|
||
#include <thrust/logical.h> | ||
|
||
#include <algorithm> | ||
#include <atomic> | ||
#include <map> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,6 @@ | |
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include <thrust/count.h> | ||
#include <thrust/logical.h> | ||
#include <thrust/transform_reduce.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
|
||
#include <limits> | ||
|
||
#include "impl.h" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -636,9 +636,9 @@ TEST(Boolean, BooleanVolumes) { | |
// m7 = m1 + m2 + m3 | ||
auto m1 = Manifold::Cube({1, 1, 1}); | ||
auto m2 = Manifold::Cube({2, 1, 1}).Transform( | ||
glm::translate(glm::mat4(1.0f), glm::vec3(1.0f, 0, 0))); | ||
glm::mat4x3(glm::translate(glm::mat4(1.0f), glm::vec3(1.0f, 0, 0)))); | ||
auto m4 = Manifold::Cube({4, 1, 1}).Transform( | ||
glm::translate(glm::mat4(1.0f), glm::vec3(3.0f, 0, 0))); | ||
glm::mat4x3(glm::translate(glm::mat4(1.0f), glm::vec3(3.0f, 0, 0)))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason we're using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, I found that we actually set |
||
auto m3 = Manifold::Cube({3, 1, 1}); | ||
auto m7 = Manifold::Cube({7, 1, 1}); | ||
|
||
|
@@ -906,4 +906,4 @@ TEST(Boolean, Sweep) { | |
#endif | ||
|
||
PolygonParams().processOverlaps = false; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, we upload the artifact to the wheelhouse, but what do with it? Should we add a release action? Should we try TestPyPI first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/pypa/cibuildwheel/blob/e8bb208374117ef8e54e28f8fada054fbe701cc8/examples/github-deploy.yml#L44-L63