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

Make inflection package truly optional #9303

Merged
merged 2 commits into from
Mar 18, 2024

Conversation

browniebroke
Copy link
Contributor

@browniebroke browniebroke commented Mar 18, 2024

Description

Fix #9291

The 3.15 release started to use the inflection package (#8017), but this was neither added as a dependency from DRF nor properly documented.

Since this is only needed for generating the OpenAPI schema (which is deprecated), I don't think it's worth introducing this package as a hard dependency, we can document it like pyyaml and uritemplate.

Since the former solution was 1 3 lines, perhaps we can use it as fallback when inflection isn't installed?

@browniebroke browniebroke changed the title Make inflection package truly optional Make inflection package truly optional Mar 18, 2024
@auvipy auvipy requested a review from tfranzel March 18, 2024 20:24
Copy link
Member

@tfranzel tfranzel left a comment

Choose a reason for hiding this comment

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

Actually I would handle it analog to uritemplate, which does a graceful import and then asserts on it missing during a call.

I don't like this because it is inconsistent with the other optional libs and also silently uses a slightly degraded implementation without anyone noticing.

I think it should be like this:

assert uritemplate, '`uritemplate` must be installed for OpenAPI schema support.'

@browniebroke
Copy link
Contributor Author

Fair enough

Copy link
Member

@tfranzel tfranzel left a comment

Choose a reason for hiding this comment

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

awesome. thanks @browniebroke

@tfranzel tfranzel merged commit 2f66c29 into encode:master Mar 18, 2024
9 checks passed
@browniebroke browniebroke deleted the fix-inflection-optional-package branch March 18, 2024 22:43
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.

3.15 missing package inflection
2 participants