Pipenv: Pipenv can't find setup.py in dependency with subdirectory

Created on 12 Oct 2018  Â·  6Comments  Â·  Source: pypa/pipenv

Issue description

One of our projects has a dependency on a private git repo. The dependency is in a subdirectory of that repo, which is a monorepo. The dependency is specified in the Pipfile like this:

mypackage = {editable = true, subdirectory = "mypackage", git = "ssh://[email protected]/myorg/myrepo.git"}

Expected result

The repo should be cloned, and pipenv should execute the setup.py in the _subdirectory_ of the repo. I have confirmed this is the case in the following versions of pipenv:

  • 2018.05.18
  • 2018.7.1

Actual result

Pipenv tries to execute python setup.py ... in the root of the dependency, rather than in the subdirectory as expected. Installing the same dependency using the latest version of pip directly still works. I verified that this issue was introduced in pipenv==2018.10.9.

Steps to replicate

  1. Create a git repo with a Python package in a subdirectory of the repo. The subdirectory should contain a setup.py, but the root of the repo should not.
  2. Create a second Python package with a dependency on the package from step 1, as per the above Pipfile config.
  3. Run pipenv install and note that the installation of the dependency fails because pipenv looks for setup.py in the root of the cloned repo, rather than in the subdirectory.
VCS Type Vendored Dependencies

Most helpful comment

Thanks guys I think I have a fix, having a testable example was super helpful

All 6 comments

I can confirm, there's been a pull request to support this in the past: https://github.com/pypa/pipenv/pull/507
But it still does not appear to be working.

Example output:

# pipenv install -e 'git+https://github.com/WoLpH/redisrpc.git@asyncio#egg=redisrpc&subdirectory=python'
Installing -e git+https://github.com/WoLpH/redisrpc.git@asyncio#egg=redisrpc&subdirectory=python…
Obtaining redisrpc from git+https://github.com/WoLpH/redisrpc.git@asyncio#egg=redisrpc
  Updating .venv/src/redisrpc clone (to revision asyncio)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File ".venv/lib/python3.6/tokenize.py", line 452, in open
        buffer = _builtin_open(filename, 'rb')
    FileNotFoundError: [Errno 2] No such file or directory: '.venv/src/redisrpc/setup.py'

    ----------------------------------------

Error:  An error occurred while installing -e git+https://github.com/WoLpH/redisrpc.git@asyncio#egg=redisrpc&subdirectory=python!
/bin/sh: -i: not found
Command "python setup.py egg_info" failed with error code 1 in .venv/src/redisrpc/

This is likely caused by a bug in redisrpc. Report this to its maintainers.

Note that installing it through pip works effortlessly.

I think I may have introduced this bug recently. @WoLpH can you tell me what shell you're using?

I'm using the z-shell

Not sure if it broke recently, this is the first time I've tried one of these with pipenv to be honest.

I'm pretty sure it broke recently, I've been relying on this feature for months and it only broke when 2018.10.9 was released

Thanks guys I think I have a fix, having a testable example was super helpful

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacek-jablonski picture jacek-jablonski  Â·  3Comments

erinxocon picture erinxocon  Â·  3Comments

jerzyk picture jerzyk  Â·  3Comments

jakul picture jakul  Â·  3Comments

fbender picture fbender  Â·  3Comments