-
Notifications
You must be signed in to change notification settings - Fork 110
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
Grasshopper GHPY libraries install #770
Conversation
@romanarust I made the method public, because we'll be using it from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Extension Points documentation additions don't link anywhere, but that can be taken later. Code looks good, but I admit there's been no functional testing.
for item in result: | ||
try: | ||
package, message, success = item | ||
status = 'OK' if success else 'ERROR' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should an error here result in an exit_code = -1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're right, fixed at 7b6ef0d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a little more complicated. Shouldn't all the successes be collected into some list successes
and then instead of returning True, all(successes)
is returned?
src/compas_rhino/install.py
Outdated
status = 'OK' if success else 'ERROR' | ||
print(' {} {}: {}'.format(package.ljust(20), status, message)) | ||
except ValueError: | ||
post_execution_errors.append(ValueError('Step successful, but result is wrongly formatted: {}'.format(str(result)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here, should result
be item
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ups! 6440b4d
src/compas_rhino/install.py
Outdated
for error in post_execution_errors: | ||
print(' - {}'.format(repr(error))) | ||
|
||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing to me. If there are post_execution_errors
, then it's been printed that the step was successful, but now we are getting an -1 exit code. So is it a success or an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's that I don't like the message of the ValueError
. If the result isn't formatted correctly how can it be assume that the step was successful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh... mmm... fair point. how about: ValueError('Step ran without errors but result is wrongly formatted: {}'.format(str(item))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is a less confusing message for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done! 4836330
On COMPAS FAB we started to make Grasshopper components that are compiled in a library (.GHPY) (compas-dev/compas_fab#249).
For installing that library, it needs to be copied into the Grasshopper library path. This action is ideally executed when calling
python -m compas_rhino.install
As suggested by @gonzalocasas, compas core should know how to install GH components, and other packages only need to provide the component locations.
For the time being, we're providing two extension points (
pluggable
interfaces) to allow hooking up into the install/uninstall and do arbitrary stuff. This will be a good solution until we sort out all the details of the installation (and potentially compilation) of GH components on end-user machines.What type of change is this?
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.CHANGELOG.md
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
).compas.datastructures.Mesh
.