Issue #355 new

pip install local_package[test] doesn't seem to work

Brandon Maister
created an issue

According to daniel holth's comment on #130, after installing a package from a local directory installing extras should be possible using the normal pip command, but it seems to require the -e '.[test]' form.

Given a clean environment:

➜  /tmp/foopkg
mktmpenv
New python executable in 7d934d005425d7f4/bin/python
Installing distribute...........................................................................................................................................................................................................................done.
Installing pip................done.
virtualenvwrapper.user_scripts creating /home/bwm/.virtualenvs/7d934d005425d7f4/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/bwm/.virtualenvs/7d934d005425d7f4/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/bwm/.virtualenvs/7d934d005425d7f4/bin/preactivate
virtualenvwrapper.user_scripts creating /home/bwm/.virtualenvs/7d934d005425d7f4/bin/postactivate
virtualenvwrapper.user_scripts creating /home/bwm/.virtualenvs/7d934d005425d7f4/bin/get_env_details
This is a temporary environment. It will be deleted when you run 'deactivate'.

(7d934d005425d7f4)➜  ~VIRTUAL_ENV
cd -
/tmp/foopkg

(7d934d005425d7f4)➜  /tmp/foopkg
python -c 'import pip; print pip.__version__'
1.2.1

And a simple setup.py:

(7d934d005425d7f4)  /tmp/foopkg
cat setup.py
from setuptools import setup

setup(name="foopkg",
      install_requires=['requests'],
      tests_require=['mock'],
      )

And a regular local pip install:

(7d934d005425d7f4)➜  /tmp/foopkg
pip install .
Unpacking /tmp/foopkg
  Running setup.py egg_info for package from file:///tmp/foopkg

Downloading/unpacking requests (from foopkg==0.0.0)
  Downloading requests-1.1.0.tar.gz (337kB): 337kB downloaded
  Running setup.py egg_info for package requests

Installing collected packages: requests, foopkg
  Running setup.py install for requests

  Running setup.py install for foopkg

Successfully installed requests foopkg
Cleaning up...

This doesn't work:

(7d934d005425d7f4)➜  /tmp/foopkg
pip install 'foopkg[test]'
Requirement already satisfied (use --upgrade to upgrade): foopkg[test] in /home/bwm/.virtualenvs/7d934d005425d7f4/lib/python2.7/site-packages
  Installing extra requirements: 'test'
Requirement already satisfied (use --upgrade to upgrade): requests in /home/bwm/.virtualenvs/7d934d005425d7f4/lib/python2.7/site-packages (from foopkg[test])
Cleaning up...

this does:

(7d934d005425d7f4)➜  /tmp/foopkg
pip install -e '.[test]'
Obtaining file:///tmp/foopkg
  Running setup.py egg_info for package from file:///tmp/foopkg

  Installing extra requirements: 'test'
Requirement already satisfied (use --upgrade to upgrade): requests in /home/bwm/.virtualenvs/7d934d005425d7f4/lib/python2.7/site-packages (from foopkg==0.0.0)
Installing collected packages: foopkg
  Running setup.py develop for foopkg

    Creating /home/bwm/.virtualenvs/7d934d005425d7f4/lib/python2.7/site-packages/foopkg.egg-link (link to .)
    Adding foopkg 0.0.0 to easy-install.pth file

    Installed /tmp/foopkg
Successfully installed foopkg
Cleaning up...

Comments (1)

  1. Log in to comment