Skip to content
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

Use PEP 503 environment markers to control ML dependency installation #6588

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- Rename master branch to main.
- Support in memory loading of XYZ files
- Fix geometry picker Error when LineSet objects are presented (PR #6499)
- Use PEP 508 environment markers to control ML dependency installation (PR #6588)

## 0.13

Expand Down
15 changes: 12 additions & 3 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,18 @@ def finalize_options(self):
install_requires = [line.strip() for line in f.readlines() if line]

# Read requirements for ML.
if "@BUNDLE_OPEN3D_ML@" == "ON":
with open("@OPEN3D_ML_ROOT@/requirements.txt", "r") as f:
install_requires += [line.strip() for line in f.readlines() if line]
with open("@OPEN3D_ML_ROOT@/requirements.txt", "r") as f:
# Unconditionally include the ML dependencies so that all wheels share
# the same dependencies. This is needed for the PyPI JSON API to
# return consistent results, which tools such as Poetry depend on.
# https://discuss.python.org/t/pep-rfc-python-package-index-warehouse-json-api-v1/9205/23
# Use PEP 508 environment markers to limit installation of ML
# dependencies to only where they are needed.
install_requires += [
f'{line.strip()} ; platform_system == "Darwin" or (platform_system == "Linux" and platform_machine == "x86_64")'
for line in f.readlines()
if line
]

entry_points = {
"console_scripts": ["open3d = @[email protected]:main",]
Expand Down
Loading