-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for Python Optional Dependencies
Split out visualization and ml modules as optional dependencies
- Loading branch information
Showing
16 changed files
with
98 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
numpy>=1.18.0 | ||
dash>=2.6.0 | ||
werkzeug>=2.2.3 | ||
nbformat==5.7.0 | ||
configargparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dash>=2.6.0 | ||
werkzeug>=2.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ | |
# IN THE SOFTWARE. | ||
# ---------------------------------------------------------------------------- | ||
|
||
from collections import defaultdict | ||
from setuptools import setup, find_packages | ||
from setuptools.command.install import install as _install | ||
import os | ||
|
@@ -118,10 +119,44 @@ def finalize_options(self): | |
with open('requirements.txt', 'r') as f: | ||
install_requires = [line.strip() for line in f.readlines() if line] | ||
|
||
# Read requirements for ML. | ||
# Read extra requirements for GUI/ML/TF/Torch. | ||
extra_requires = defaultdict(list) | ||
|
||
# GUI Deps | ||
with open('requirements_gui.txt', 'r') as f: | ||
extra_requires['gui'] += [line.strip() for line in f.readlines() if line] | ||
|
||
# Make sure GUI deps is part of "all" | ||
extra_requires['all'] += extra_requires['gui'] | ||
|
||
if '@BUNDLE_OPEN3D_ML@' == 'ON': | ||
# ML Deps | ||
with open('@OPEN3D_ML_ROOT@/requirements.txt', 'r') as f: | ||
install_requires += [line.strip() for line in f.readlines() if line] | ||
extra_requires['ml'] += [line.strip() for line in f.readlines() if line] | ||
extra_requires['all'] += extra_requires['ml'] | ||
|
||
# ML + TF Deps | ||
with open('@OPEN3D_ML_ROOT@/requirements-tensorflow.txt', 'r') as f: | ||
extra_requires['tf'] += extra_requires['ml'] | ||
extra_requires['tf'] += [line.strip() for line in f.readlines() if line] | ||
extra_requires['all'] += extra_requires['tf'] | ||
|
||
# ML + Torch Deps | ||
if '@BUILD_CUDA_MODULE@' == 'ON': | ||
torch_reqs = '@OPEN3D_ML_ROOT@/requirements-torch-cuda.txt' | ||
else: | ||
torch_reqs = '@OPEN3D_ML_ROOT@/requirements-torch.txt' | ||
with open(torch_reqs, 'r') as f: | ||
extra_requires['torch'] += extra_requires['ml'] | ||
extra_requires['torch'] += [ | ||
line.strip() | ||
for line in f.readlines() | ||
if line and not line.startswith("-") | ||
] | ||
extra_requires['all'] += extra_requires['torch'] | ||
|
||
# Dedupe Extras w/ All | ||
extra_requires['all'] = list(set(extra_requires['all'])) | ||
|
||
entry_points = { | ||
'console_scripts': ['open3d = @[email protected]:main',] | ||
|
@@ -139,6 +174,7 @@ def finalize_options(self): | |
python_requires='>=3.6', | ||
include_package_data=True, | ||
install_requires=install_requires, | ||
extras_require=extra_requires, | ||
packages=find_packages(), | ||
entry_points=entry_points, | ||
zip_safe=False, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters