Skip to content

Commit 6b0edcd

Browse files
authored
Merge pull request #200 from compas-dev/rhino-installer-plugin
Use new extension point for declaring rhino installable packages
2 parents 7f82500 + e59379f commit 6b0edcd

File tree

6 files changed

+14
-51
lines changed

6 files changed

+14
-51
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Unreleased
3636
* Parameter ``backend`` of forward kinematics has been renamed to ``solver``
3737
* The signatures of all kinematics, motion planning and planning scene management methods have been homogenized across backend clients and within ``Robot``
3838
* All examples have been updated to reflect these changes
39+
* The installer to Rhino has been unified with COMPAS core. Now running ``python -m compas_rhino.install`` will also detect and install COMPAS FAB and its dependencies.
3940
* Renamed all ``RobotArtist`` implementations to ``RobotModelArtist`` to reflect
4041
the fact they depend on ``compas.robots.RobotModel``.
4142
* Renamed ``compas_fab.robots.Robot.from_tool0_to_attached_tool`` to ``compas_fab.robots.Robot.from_t0cf_to_tcf``

docs/getting_started.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ Working in Rhino
4040
================
4141

4242
To make **COMPAS FAB** available inside Rhino, open the *command prompt*
43-
and type the following which will install it on both Rhino 5.0 and 6.0:
43+
and type the following:
4444

4545
::
4646

47-
python -m compas_fab.rhino.install -v 5.0
48-
python -m compas_fab.rhino.install -v 6.0
47+
python -m compas_rhino.install
4948

5049
.. note:
5150

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
requirements = [
1313
# Until COMPAS reaches 1.0, we pin major.minor and allow patch version updates
14-
'compas>=0.16.4,<0.17',
14+
'compas>=0.16.8,<0.17',
1515
'roslibpy>=1.1.0',
1616
'pybullet',
1717
'pyserial',

src/compas_fab/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,5 @@ def get(filename):
6969
except Exception:
7070
pass
7171

72+
__all_plugins__ = ['compas_fab.rhino.install']
7273
__all__ = ['__author__', '__author_email__', '__copyright__', '__description__', '__license__', '__title__', '__url__', '__version__', 'get']

src/compas_fab/rhino/install.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,15 @@
22
from __future__ import division
33
from __future__ import print_function
44

5-
import compas
6-
if compas.RHINO:
7-
import compas_rhino.install
5+
import compas.plugins
86

9-
__all__ = []
107

11-
INSTALLABLE_PACKAGES = ['compas_fab', 'roslibpy']
8+
@compas.plugins.plugin(category='install')
9+
def installable_rhino_packages():
10+
return ['compas_fab', 'roslibpy']
1211

1312

14-
# ==============================================================================
15-
# Main
16-
# ==============================================================================
17-
1813
if __name__ == "__main__":
19-
20-
import argparse
21-
22-
parser = argparse.ArgumentParser()
23-
parser.add_argument('-v', '--version', choices=['5.0', '6.0'], default='6.0', help="The version of Rhino to install the packages in.")
24-
25-
args = parser.parse_args()
26-
27-
packages = set(compas_rhino.install.INSTALLABLE_PACKAGES + INSTALLABLE_PACKAGES)
28-
29-
compas_rhino.install.install(version=args.version, packages=packages)
14+
print('This installation method is obsolete.')
15+
print('Please use `python -m compas_rhino.install` instead')
16+
print('COMPAS FAB will be automatically detected and installed')

src/compas_fab/rhino/uninstall.py

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,6 @@
22
from __future__ import division
33
from __future__ import print_function
44

5-
import compas
6-
import compas_fab.rhino.install
7-
8-
if compas.RHINO:
9-
import compas_rhino.install
10-
import compas_rhino.uninstall
11-
12-
13-
__all__ = []
14-
15-
16-
# ==============================================================================
17-
# Main
18-
# ==============================================================================
19-
205
if __name__ == "__main__":
21-
22-
import argparse
23-
24-
parser = argparse.ArgumentParser()
25-
26-
parser.add_argument('-v', '--version', choices=['5.0', '6.0'], default='5.0', help="The version of Rhino to install the packages in.")
27-
28-
args = parser.parse_args()
29-
30-
packages = set(compas_rhino.install.INSTALLABLE_PACKAGES + compas_fab.rhino.install.INSTALLABLE_PACKAGES)
31-
32-
compas_rhino.uninstall.uninstall(version=args.version, packages=packages)
6+
print('This uninstallation method is obsolete.')
7+
print('Please use `python -m compas_rhino.uninstall` instead')

0 commit comments

Comments
 (0)