Skip to content

Commit

Permalink
Merge pull request #1098 from compas-dev/global-installation-arguments
Browse files Browse the repository at this point in the history
Fix bug in processing of command line arguments during installation.
  • Loading branch information
tomvanmele authored Nov 9, 2022
2 parents 75bd863 + fb10772 commit 3aa0a64
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

* Added `compas_rhino.INSTALLATION_ARGUMENTS`.

### Changed

* Fixed bug in Rhino installation due to redefinition of command line arguments in `compas_ghpython.components.get_version_from_args`.

### Removed


Expand Down
10 changes: 1 addition & 9 deletions src/compas_ghpython/components/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"""
from __future__ import absolute_import

import argparse
import glob
import os

Expand All @@ -34,14 +33,7 @@


def get_version_from_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"-v",
"--version",
choices=compas_rhino.SUPPORTED_VERSIONS,
default=compas_rhino.DEFAULT_VERSION,
)
args = parser.parse_args()
args = compas_rhino.INSTALLATION_ARGUMENTS
return _check_rhino_version(args.version)


Expand Down
2 changes: 2 additions & 0 deletions src/compas_rhino/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
SUPPORTED_VERSIONS = ["5.0", "6.0", "7.0", "8.0"]
DEFAULT_VERSION = "7.0"

INSTALLATION_ARGUMENTS = None

IRONPYTHON_PLUGIN_GUID = "814d908a-e25c-493d-97e9-ee3861957f49"
GRASSHOPPER_PLUGIN_GUID = "b45a29b1-4343-4035-989e-044e8580d9cf"
RHINOCYCLES_PLUGIN_GUID = "9bc28e9e-7a6c-4b8f-a0c6-3d05e02d1b97"
Expand Down
3 changes: 2 additions & 1 deletion src/compas_rhino/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,9 @@ def _filter_installable_packages(version, packages):
help="The version of Rhino to install the packages in.",
)
parser.add_argument("-p", "--packages", nargs="+", help="The packages to install.")
parser.add_argument("--clean", dest="clean", default=False, action="store_true")
parser.add_argument("-c", "--clean", default=False, action="store_true", help="Clean up the installation directory")

args = parser.parse_args()
compas_rhino.INSTALLATION_ARGUMENTS = args

install(version=args.version, packages=args.packages, clean=args.clean)
3 changes: 0 additions & 3 deletions src/compas_rhino/install_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
from .install import install as install_packages


__all__ = ["install_plugin"]


def install_plugin(plugin, version=None):
"""Install a Rhino Python Command Plugin.
Expand Down

0 comments on commit 3aa0a64

Please sign in to comment.