Skip to content

Use extra requires to seperate optional features django-filter and polymorphic #674

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
sliverc opened this issue Jul 5, 2019 · 3 comments · Fixed by #715
Closed

Use extra requires to seperate optional features django-filter and polymorphic #674

sliverc opened this issue Jul 5, 2019 · 3 comments · Fixed by #715

Comments

@sliverc
Copy link
Member

sliverc commented Jul 5, 2019

The optional features (Polymorphic and Django filter) should define their dependencies as extra.

Currently this is only done as test requires but actual users won't have enforced minimum requirements.

Once this is done a user can simply add following into their requirements to properly activate an optional feature:

djangorestframework-jsonapi[django-filter] == 2.8.0

see
https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies

@n2ygk
Copy link
Contributor

n2ygk commented Aug 11, 2019

@sliverc should this be done using something similar to DRF's compat.py (never mind)

@n2ygk
Copy link
Contributor

n2ygk commented Aug 13, 2019

@sliverc I've been staring at this for a bit... One issue is that I want to have the following extra-requires but one of them has it's own Django version constraints:

django-oauth-toolkit>=1.2.0 only when django>=2. If django>=1.11,<2, then django-oauth-toolkit>=1.1,<1.2 -- but my TokenMatchesOASRequirements is only implemented in DOT 1.2, so DOT not even need for 1.1 (I suppose I could back port it...). You can see this in tox.ini/.travis.yml changes I've made in #689.

I'm not sure if setup.py's extra_requires can be customized based on Django version. Do you know if it can?

@sliverc
Copy link
Member Author

sliverc commented Aug 15, 2019

I don't think this is possible. However #689 will need some discussion also around the oauth feature.

This shouldn't affect implementing this issue for django-filter and django-polymorphic though. And I am sure for #689 we will find a suitable option.

sliverc added a commit to sliverc/django-rest-framework-json-api that referenced this issue Oct 3, 2019
Fixes django-json-api#674

Currently only django-filter and django-polymorphic use the extra_requires
definition.
sliverc added a commit to sliverc/django-rest-framework-json-api that referenced this issue Oct 3, 2019
Fixes django-json-api#674

Currently only django-filter and django-polymorphic use the extra_requires
definition.
sliverc added a commit to sliverc/django-rest-framework-json-api that referenced this issue Oct 3, 2019
Fixes django-json-api#674

Currently only django-filter and django-polymorphic use the extra_requires
definition.
@n2ygk n2ygk closed this as completed in #715 Oct 3, 2019
n2ygk pushed a commit that referenced this issue Oct 3, 2019
Fixes #674

Currently only django-filter and django-polymorphic use the extra_requires
definition.
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 a pull request may close this issue.

2 participants