-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix syntax error when building with nuitka #2635
Conversation
Interesting. Did you notice any difference with Rich as compiled C? |
Codecov ReportBase: 98.38% // Head: 98.25% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #2635 +/- ##
==========================================
- Coverage 98.38% 98.25% -0.13%
==========================================
Files 64 64
Lines 6807 6816 +9
==========================================
Hits 6697 6697
- Misses 110 119 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I've only tried a few components ( nuitka3 \
--follow-imports \
--remove-output \
--lto=yes \
--static-libpython=no \
--include-package=pygments \
-o output \
main.py There may be minor performance differences, but I'm not pushing it hard enough yet to tell. |
@@ -272,7 +272,7 @@ def __call__(self, value: Any) -> Any: | |||
# replace plain text formatter with rich formatter | |||
rich_formatter = RichFormatter() | |||
ip.display_formatter.formatters["text/plain"] = rich_formatter | |||
except Exception: |
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.
While I never used nuitka, I know enough to solute removal of "except Exception" ;)
Type of changes
Checklist
Description
Nuitka throws a syntax error when building the
rich.pretty
module because of the missing symbolget_ipython
. Instead of using try/except as control flow, it's better to explicitly check for the existence of this global function.Otherwise, rich works well when converted into C with Nuitka. Thanks!