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

mitigate global dependency on inflection #8017 #8781

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

tfranzel
Copy link
Member

#8017 indirectly introduced a new hard dependency. rest_framework.openapi.AutoSchema is imported in the default settings, which makes this a new dependency for nearly everyone. That is the reason why the builds are failing at the moment, as the tox -e base target does not install the optionals.

So either we move that newly introduced import out of the main code path or DRF needs to gain that dependency in setup.py, which would probably be excessive.

rest_framework/schemas/openapi.py Show resolved Hide resolved
@auvipy auvipy merged commit 5435b2c into encode:master Nov 28, 2022
@auvipy auvipy added the Bug label Nov 28, 2022
@tfranzel tfranzel deleted the fix_inflection_requirement branch November 28, 2022 10:35
cweider added a commit to cweider/courtlistener that referenced this pull request Aug 23, 2023
A dependency on encode/django-rest-framework#8017 and later
made less obtrusive by encode/django-rest-framework#8781, but
it did not eliminate it. Any usage of the schema generator
must be done in an environment that includes this package.
cweider added a commit to cweider/courtlistener that referenced this pull request Aug 23, 2023
A dependency on encode/django-rest-framework#8017 and later
made less obtrusive by encode/django-rest-framework#8781, but
it did not eliminate it. Any usage of the schema generator
must be done in an environment that includes this package.
cweider added a commit to cweider/courtlistener that referenced this pull request Aug 23, 2023
`django-rest-framework` has recieved several patches for
CSP compatibility, but unfortunately these are not included
in the latest release (3.14.0) and a new release cannot be
expected for a while.

As such, we must replace the semantically versioned PyPI
reference with a reference to the latest commit on the master
branch of the package's Git Repository that contains the
changes that we need (do not use `master` since it could
change in unexpected and incompatible ways).

Included in this change is the `inflection` package,
unfortunate dependency added by encode/django-rest-framework#8017
and later made less obtrusive by encode/django-rest-framework#8781,
but it did not eliminate it. Any usage of the schema generator
must be done in an environment that includes this package.

Fixes: freelawproject#3020
cweider added a commit to cweider/courtlistener that referenced this pull request Aug 23, 2023
`django-rest-framework` has recieved several patches for
CSP compatibility, but unfortunately these are not included
in the latest release (3.14.0) and a new release cannot be
expected for a while.

As such, we must replace the semantically versioned PyPI
reference with a reference to the latest commit on the master
branch of the package's Git Repository that contains the
changes that we need (do not use `master` since it could
change in unexpected and incompatible ways).

Included in this change is the use of `inflection` for the
OpenAPI spec's `operationIds`, an unfortunate dependency
added by encode/django-rest-framework#8017 and later made
less obtrusive by encode/django-rest-framework#8781. Any
usage of the schema generator must be done in an environment
that includes this package. Additionally, this new approach
makes the generated `operationId` that was `listPersons` into
`listPeople`. Thankfully, this is immaterial.

Fixes: freelawproject#3020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants