2

I have the following Pipfile with a single dependency from git:

[packages]
requests = {editable = true, git = "https://github.com/requests/requests.git",ref = "v2.20.1"}

Then I run:

pipenv install
pipenv run pip freeze >requirements.txt

Which generates this requirements.txt:

certifi==2020.6.20
chardet==3.0.4
idna==2.7
-e git+https://github.com/requests/requests.git@6cfbe1aedd56f8c2f9ff8b968efe65b22669795b#egg=requests
urllib3==1.24.3

Now this works fine: pipenv run pip install -r requirements.txt

But this doesn't: pipenv run pip install -r requirements.txt --target dist

Error:

Installing collected packages: certifi, chardet, idna, urllib3, requests
  Attempting uninstall: requests
    Found existing installation: requests 2.20.1
    Uninstalling requests-2.20.1:
      Successfully uninstalled requests-2.20.1
  Running setup.py develop for requests
    ERROR: Command errored out with exit status 1:
     command: /Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/src/requests/setup.py'"'"'; __file__='"'"'/Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/src/requests/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --home /private/var/folders/1f/_zft4b3x3bb6nbc_rl4n_9zr0000gn/T/pip-target-nxsmebki
         cwd: /Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/src/requests/
    Complete output (6 lines):
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help

    error: option --home not recognized
    ----------------------------------------
  Rolling back uninstall of requests
  Moving to /Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/lib/python3.8/site-packages/requests.egg-link
   from /private/var/folders/1f/_zft4b3x3bb6nbc_rl4n_9zr0000gn/T/pip-uninstall-iilp2si9/requests.egg-link
ERROR: Command errored out with exit status 1: /Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/src/requests/setup.py'"'"'; __file__='"'"'/Users/cahen/.local/share/virtualenvs/my-project-HJAU6iyr/src/requests/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --home /private/var/folders/1f/_zft4b3x3bb6nbc_rl4n_9zr0000gn/T/pip-target-nxsmebki Check the logs for full command output.

If I remove editable = true, it will work, but I need it to be editable so transitive dependencies are added to the Pipfile.lock as described here.

So my question is: why the --target flag doesn't work when requirements.txt has an editable dependency from git?

I'm using python 3.8.2 and pip 20.2.2.

cahen
  • 15,807
  • 13
  • 47
  • 78

0 Answers0