Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing python pip package from tar.gz with extra includes

I have a python package being built, which also has two options for extra_includes:

name='mypackage',
extras_require={
    'option_one': ['dep1'],
    'option_two': ['dep2']
}

I only have access to the tar.gz built package which means I cannot simply do:

pip install mypackage[option_two]

Previously, I was directly installing this directly from the tar.gz:

pip install path/to/mypackage.tar.gz

However, this no longer allows me to specify the extra_require like:

pip install path/to/mypackage.tar.gz[option_two] # this is wrong

I could expand the package and do a manual install from the directory but is there a way to more directly install from the tar.gz itself?

like image 997
enderland Avatar asked Jul 25 '26 17:07

enderland


1 Answers

From the pip changelog:

7.0.0 (2015-05-21)

  • Allowing using extras when installing from a file path without requiring the use of an editable (PR #2785).

Some Linux distros bundle very old versions of pip when using the system packages for virtualenv or venv. Update pip after creating your env.

pip install -U pip
pip install package.tar.gz[name]
like image 182
davidism Avatar answered Jul 28 '26 05:07

davidism