Skip to content

WIP: catch plugin loading failure #1817

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

Closed
wants to merge 2 commits into from
Closed

Conversation

ssbarnea
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Jan 13, 2021

Codecov Report

Merging #1817 (0cd7144) into rewrite (a9fa22e) will decrease coverage by 0.02%.
The diff coverage is 77.77%.

Impacted file tree graph

@@             Coverage Diff             @@
##           rewrite    #1817      +/-   ##
===========================================
- Coverage    99.76%   99.73%   -0.03%     
===========================================
  Files          133      133              
  Lines         7128     7133       +5     
  Branches       711      711              
===========================================
+ Hits          7111     7114       +3     
- Misses           6        8       +2     
  Partials        11       11              
Flag Coverage Δ
tests 99.73% <77.77%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/tox/plugin/manager.py 94.87% <77.77%> (-5.13%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a9fa22e...0cd7144. Read the comment docs.

Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

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

Yeah, something similar I was thinking.

@@ -42,12 +43,16 @@ def __init__(self) -> None:
)

for plugin in internal_plugins:
logging.info("Registering %s", plugin)
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to be silent if nothing bad happens.

REGISTER.populate(self)
self.manager.check_pending()
except ImportError as e:
logging.warning("Ignored plugin %s which failed to load. %s", NAME, e)
Copy link
Member

Choose a reason for hiding this comment

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

Here you want %r to show the type too. And ideally, we'd also show the last source code line of the traceaback (you can get it via traceback.format_exc).

@gaborbernat
Copy link
Member

I'll close this now as it seems we'll not be able to merge it.

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