Opened 6 years ago

Closed 5 years ago

#27682 closed Cleanup/optimization (duplicate)

Add more dependencies to extras_require (eg sqlparse, PyYAML)

Reported by: Ed Morley Owned by: Ed Morley
Component: Packaging Version: dev
Severity: Normal Keywords:
Cc: cdosborn@… Triage Stage: Someday/Maybe
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


There are several optional Django features that require third-party Python packages that (intentionally) aren't specified as install_requires dependencies in, since not everyone would want them installed.

For example:

  • PyYAML for the yaml serializer
  • sqlparse for multi-line SQL statements for migrations RunSQL
  • Database drivers

Adding these as extras_require [*] entries has the following advantages:

1) The reason for the packages is now self-documenting. eg:


...instead of:


# Required by Django's migration system for RunSQL commands.

# Required by Django's YAML serializer.

2) Django could in the future manage the preferred package for a particular feature in cases where there is a choice (eg mysqlclient vs MySQL-python). Users can still override by not using the extras_require alias (or there could even be multiple aliases).

3) If a new major version of Django stops requiring a particular extras_require dependency, users will know to remove it from their requirements files, since pip will warn there is no such extra listed.


Change History (5)

comment:1 Changed 6 years ago by Ed Morley

Owner: changed from nobody to Ed Morley

comment:2 Changed 6 years ago by Josh Smeaton

I think I like this idea, but it's probably a change sufficient enough to bring up on the mailing list!forum/django-developers

comment:3 Changed 6 years ago by Tim Graham

Triage Stage: UnreviewedSomeday/Maybe

comment:4 Changed 6 years ago by Connor Osborn

Cc: cdosborn@… added

comment:5 Changed 5 years ago by Carlton Gibson

Resolution: duplicate
Status: assignedclosed

I'm going to resolve this as a duplicate of #28905. Whilst this issue was prior, #28905 is further along. (It has a PR)

Note: See TracTickets for help on using tickets.
Back to Top