Skip to content
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

Fixed compas_ghpython is not importable in Rhino8 #1391

Merged
merged 20 commits into from
Oct 2, 2024
Merged

Conversation

chenkasirer
Copy link
Member

@chenkasirer chenkasirer commented Sep 29, 2024

  • Fixed compas_ghpython not importable in Rhino 8 CPython components, mostly by:
    • Avoiding compas_rhino.drawing imports within compas_ghpython
    • Modifying the plugin discovery logic to catch a new type of exception.
  • Retired deprecated module compas_ghpython.utilities.

What type of change is this?

  • Bug fix in a backwards-compatible manner.
  • New feature in a backwards-compatible manner.
  • Breaking change: bug fix or new feature that involve incompatible API changes.
  • Other (e.g. doc update, configuration, etc)

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.

  • I added a line to the CHANGELOG.md file in the Unreleased section under the most fitting heading (e.g. Added, Changed, Removed).
  • I ran all tests on my computer and it's all green (i.e. invoke test).
  • I ran lint on my computer and there are no errors (i.e. invoke lint).
  • I added new functions/classes and made them available on a second-level import, e.g. compas.datastructures.Mesh.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

Copy link

codecov bot commented Sep 29, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 60.25%. Comparing base (db0c5b0) to head (85f002d).
Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
src/compas/plugins.py 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1391      +/-   ##
==========================================
- Coverage   60.25%   60.25%   -0.01%     
==========================================
  Files         207      207              
  Lines       22251    22257       +6     
==========================================
+ Hits        13407    13410       +3     
- Misses       8844     8847       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chenkasirer chenkasirer changed the title Gh python3 Fixed compas_ghpython is not importable in Rhino8 Oct 1, 2024
Copy link
Member

@tomvanmele tomvanmele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than a few questions, i think this is great!

src/compas/plugins.py Outdated Show resolved Hide resolved
Comment on lines 44 to 47
class DummyDotNetException(BaseException):
pass

DotNetException = DummyDotNetException
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this done in two steps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean two steps? why I'm not using BaseException directly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, why not class DotNetException(BaseException): pass

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no other reason except it never crossed my mind :)

src/compas/plugins.py Show resolved Hide resolved
src/compas_ghpython/scene/meshobject.py Outdated Show resolved Hide resolved
src/compas_ghpython/scene/volmeshobject.py Outdated Show resolved Hide resolved
Copy link
Member

@tomvanmele tomvanmele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with one comment

Comment on lines 44 to 47
class DummyDotNetException(BaseException):
pass

DotNetException = DummyDotNetException
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, why not class DotNetException(BaseException): pass

@chenkasirer chenkasirer merged commit 45ba3b7 into main Oct 2, 2024
18 checks passed
@chenkasirer chenkasirer deleted the gh_python3 branch October 2, 2024 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants