Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building a smaller python extra package

Tags:

python

pip

pypi

I have a package called mypygeopack, which has lots of dependencies. I wanted to know if I can create a small package using extras:

pip install mypygeopack[tiny]

which will install a stripped down version of the package with only 1-2 dependencies instead of the 4-5.

Thanks

like image 714
JabberJabber Avatar asked Feb 22 '26 17:02

JabberJabber


1 Answers

No, you can't. Extras can only add things, not remove.

It is a question that comes up regularly. People have discussed about it, but as far as I know, nothing concrete came out of those discussions yet:

  • https://discuss.python.org/t/is-it-valid-to-specify-extra-negative-dependency-with-pep508-markers/5277
  • https://discuss.python.org/t/the-extra-environment-marker-and-its-operators/4976
  • https://discuss.python.org/t/adding-a-default-extra-require-environment/4898
like image 91
sinoroc Avatar answered Feb 24 '26 05:02

sinoroc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!