-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
[4.0.x] Make manager required in AstroidBuilder/InspectBuilder #2313
base: main
Are you sure you want to change the base?
[4.0.x] Make manager required in AstroidBuilder/InspectBuilder #2313
Conversation
938cbee
to
c9399bb
Compare
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #2313 +/- ##
==========================================
- Coverage 92.85% 92.84% -0.01%
==========================================
Files 94 94
Lines 11056 11043 -13
==========================================
- Hits 10266 10253 -13
Misses 790 790
Flags with carried forward coverage won't be shown. Click here to find out 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.
This one bring a lot of joy. Were you able to use nodes.X
instead of X
thanks to the fixed circular imports ?
I didn't have a choice, because the second import statement [from nodes import ...] was failing because nodes was now partially installed at that point. I think before, it was an accident that nodes was fully initialized already. |
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.
Although really in favour, this do introduce more global state for AstroidManager()
, see also #2048.
As long as AstroidManager
is a singleton we'll keep accessing shared memory in multiprocessing scenarios. Ideally, to me, we would change it in 4.x
so that the manager needs to be instantiated.
Type of Changes
Description
Closes #251
Remove delayed imports in AstroidManager by requiring AstroidManager to be provided to AstroidBuilder/InspectBuilder.
A couple new delayed imports became necessary, but they're in helpers like
parse()
and_astroid_bootstrapping()
. We could address those by:_astroid_bootstrapping()
to manager.py.