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

No detailed error log during ErrorLoadingExtension #378

Closed
FlorianWilhelm opened this issue Jan 7, 2021 · 2 comments
Closed

No detailed error log during ErrorLoadingExtension #378

FlorianWilhelm opened this issue Jan 7, 2021 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@FlorianWilhelm
Copy link
Member

Description of your problem

Just produce e.g. an import error in an extension. When running putup --dsproject ... the error will be:

ERROR: There was an error loading 'pyscaffoldext-dsproject'.
    Please make sure you have installed a version of the extension that is compatible
    with PyScaffold 4.0b3.post1.dev1+ge4a1a38. You can also try unininstalling it.

In order to get to the actual cause of the error putup -vv --dsproject ... should work but due to the fact that ErrorLoadingExtension is a RuntimeError and the fact that the plugins are loaded before the error level is set, thus

  if logger.level <= logging.DEBUG:
      # user surely wants to see the stacktrace
      traceback.print_exc()
  print(f"ERROR: {ex}")

in exceptions2exit does not work as intended.

To solve this one could replace the condition logger.level <= logging.DEBUG and do some partial parsing of sys.argv with https://docs.python.org/3/library/argparse.html#partial-parsing.

Versions and main components

  • PyScaffold Version: current master
  • Python Version: 3.8
  • Operating system: MacOS
  • How did you install PyScaffold: pip
@FlorianWilhelm FlorianWilhelm added the bug Something isn't working label Jan 7, 2021
@abravalheri
Copy link
Collaborator

Hi @FlorianWilhelm thank you for reporting this bug. It looks like a tricky one... I will try to have a look at it during the weekend (no promises :P).

Meanwhile, I think this might be solved by pyscaffold/pyscaffoldext-dsproject#10 ...

@abravalheri abravalheri added this to the v4.0 milestone Jan 7, 2021
abravalheri added a commit that referenced this issue Jan 8, 2021
abravalheri added a commit that referenced this issue Jan 8, 2021
abravalheri added a commit to abravalheri/pyscaffold that referenced this issue Jan 8, 2021
abravalheri added a commit that referenced this issue Jan 8, 2021
This PR is an attempt to solve #378 (prior attempt in #381).
abravalheri added a commit that referenced this issue Jan 8, 2021
This PR is an attempt to solve #378 (prior attempt in #381).
abravalheri added a commit that referenced this issue Jan 9, 2021
This PR is an attempt to solve #378 (prior attempt in #381).
@FlorianWilhelm
Copy link
Member Author

This was fixed by @abravalheri. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants