Skip to content

Improve handling of optional packages#27

Merged
nhairs merged 4 commits into
mainfrom
nhairs-optional-extras
Oct 21, 2024
Merged

Improve handling of optional packages#27
nhairs merged 4 commits into
mainfrom
nhairs-optional-extras

Conversation

@nhairs

@nhairs nhairs commented Oct 21, 2024

Copy link
Copy Markdown
Owner

Improves handling of optional packages by:

  • No importing them just to check if available
  • Raises a more specific type of error (and message)

Test Plan

  • Run unit tests

@nhairs nhairs merged commit a1daea2 into main Oct 21, 2024
@nhairs nhairs deleted the nhairs-optional-extras branch October 21, 2024 10:42
@nhairs nhairs linked an issue Oct 21, 2024 that may be closed by this pull request
bharel pushed a commit to bharel/python-json-logger that referenced this pull request Oct 22, 2024
Improves handling of optional packages by:

- No importing them just to check if available
- Raises a more specific type of error (and message)

### Test Plan

- Run unit tests
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.

Move to importlib.util.find_spec for checking if packages are installed

1 participant