7

My Python package has optional features (extras_require) and I would prefer them to be selected by default.

More specifically, I'd like that pip install mypackage behaves like pip install mypackage[extra] and that I can install a minimal version with something like pip install mypackage[core].

setup(
    name="mypackage",
    ...
    extras_require={
        "extra":  ["extra1>=1.2", "extra2"],
        "core": [],
    }
)

Is it possible to achieve this with a setup script similar to above?

DurandA
  • 1,095
  • 1
  • 17
  • 35
  • 1
    Pretty much same question here: [How to I change the Manifest.in depending on the extra_requires I wish to use?](https://stackoverflow.com/q/48191319/674039) – wim Mar 25 '20 at 04:44

1 Answers1

4

Unfortunately this is not possible with the current state of Python packaging metadata & tooling.

See a long discussion here as to why.

Dustin Ingram
  • 20,502
  • 7
  • 59
  • 82