Opened 8 months ago

Last modified 6 weeks ago

#28905 assigned Cleanup/optimization

Overhaul extra_requires to include more optional dependencies

Reported by: Jaap Roes Owned by: Niranj Rajasekaran
Component: Packaging Version: master
Severity: Normal Keywords: setup optional dependencies packages requirements
Cc: Herbert Fortes Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Django has a number of optional features that require the installation of additional Python packages.

Right now it's possible to pip install Django[bcrypt,argon2] to install Django and the optional packages (at the correct minimum version) required for bcrypt/argon2 support.

However this is not possible for other optional features, like database/cache backend, gis, certain image related features etc.

I've created a pull request adding the optional dependencies found in the test requirements (initially only psycopg2 for postgresql, but after a comment from pope1ni I followed their suggestion to include more). It changes the set of extra_requires to:

{
    'admindocs': ['docutils'],
    'argon2': ['argon2_cffi>=16.1.0'],
    'bcrypt': ['bcrypt'],
    'gis': [
        'geoip2',
        'numpy'
    ],
    'geoip': ['geoip2'],
    'jinja2': ['Jinja2>=2.9.2'],
    'memcached': ['python3-memcached'],
    'numpy': ['numpy'],
    'mysql': ['mysqlclient>=1.3.7'],
    'oracle': ['Oracle'],
    'images': ['Pillow'],
    'postgresql': ['psycopg2>=2.5.4'],
    'pylibmc': ['pylibmc; sys.platform != "win32"'],
    'sqlparse': ['sqlparse'],
    'selenium': ['selenium'],
    'test-parallel': ['tblib'],
    'yaml': ['PyYAML'],
}

So end users can do things like:

$ pip install Django[mysql,sqlparse,images,memcached]
$ pip install Django[postgresql,gis]
$ pip install Django[selenium,test-parallel]

Not only would this make it much easier to install a particular combination of Django and optional dependencies correctly, it also makes some of the optional features/dependencies a little bit more discoverable.

This might not the full set of optional dependencies, or the right grouping/naming, so a review is more than welcome.

Besides adding this to setup.py, additional changes to the documentation, test instructions and scripts, code warnings etc. will probably be necessary.

Change History (12)

comment:1 Changed 8 months ago by Jaap Roes

Component: UncategorizedPackaging

comment:2 Changed 8 months ago by Sergey Fedoseev

Has patch: set
Triage Stage: UnreviewedAccepted

comment:3 Changed 8 months ago by Jaap Roes

I have no idea where to go from here. I assume posting this to the developer mailinglist is the best way to gather feedback on this and come to a consensus of which packages and groupings.

edit: https://groups.google.com/forum/#!topic/django-developers/6IQ5VeY6jY8

Last edited 8 months ago by Jaap Roes (previous) (diff)

comment:4 Changed 6 months ago by Carlton Gibson

Related #27682

comment:5 Changed 6 months ago by Carlton Gibson

Needs documentation: set

comment:6 Changed 3 months ago by Jaap Roes

Easy pickings: set

I don't have the time/energy to get this done, but I feel that this would be an excellent, and fairly easy, ticket for someone to work on during the Djangocon sprints

comment:7 Changed 3 months ago by oliver

Owner: changed from nobody to oliver
Status: newassigned

comment:8 Changed 3 months ago by oliver

Owner: oliver deleted
Status: assignednew

comment:9 Changed 3 months ago by Israel Fermín Montilla

Can I claim it?, I have some spare time I could invest on this

comment:10 Changed 3 months ago by Herbert Fortes

Cc: Herbert Fortes added

comment:11 Changed 3 months ago by Jaap Roes

Yes please claim it, it would be really helpful to, for example, identify pieces of documentation that should be updated when this lands.

comment:12 Changed 6 weeks ago by Niranj Rajasekaran

Owner: set to Niranj Rajasekaran
Status: newassigned
Note: See TracTickets for help on using tickets.
Back to Top