From 681d4887796ba37b27f965ce383707ad345befa7 Mon Sep 17 00:00:00 2001 From: Chen Kasirer Date: Wed, 14 Aug 2024 15:53:47 +0200 Subject: [PATCH] readability --- src/compas_rhino/install.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/compas_rhino/install.py b/src/compas_rhino/install.py index c94bfbd8db6..4fd974c813b 100644 --- a/src/compas_rhino/install.py +++ b/src/compas_rhino/install.py @@ -27,12 +27,7 @@ def _make_specs(packages, clean, versions): for version in versions: try: if version == "8.0": - ipy_lib_path = compas_rhino._get_default_rhino_ironpython_sitepackages_path(version, legacy=False) - ipy_lib_path_legacy = compas_rhino._get_default_rhino_ironpython_sitepackages_path(version, legacy=True) - cpython_lib_path = compas_rhino._get_default_rhino_cpython_sitepackages_path(version) - specs.append((ipy_lib_path, version, packages, clean)) - specs.append((ipy_lib_path_legacy, version, packages, clean)) - specs.append((cpython_lib_path, version, packages, clean)) + specs.extend(_make_rhino8_cpython_specs(packages, clean)) else: path = compas_rhino._get_rhino_scripts_path(version) specs.append((path, version, packages, clean)) @@ -41,6 +36,17 @@ def _make_specs(packages, clean, versions): return specs +def _make_rhino8_cpython_specs(packages, clean): + ipy_lib_path = compas_rhino._get_default_rhino_ironpython_sitepackages_path("8.0", legacy=False) + ipy_lib_path_legacy = compas_rhino._get_default_rhino_ironpython_sitepackages_path("8.0", legacy=True) + cpython_lib_path = compas_rhino._get_default_rhino_cpython_sitepackages_path("8.0") + return [ + (ipy_lib_path, "8.0", packages, clean), + (ipy_lib_path_legacy, "8.0", packages, clean), + (cpython_lib_path, "8.0", packages, clean), + ] + + def _install(installation_path, version=None, packages=None, clean=False): """Install COMPAS for Rhino.