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"}
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:
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
.
setup.py
, but the root of the repo should not.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.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!
Most helpful comment
Thanks guys I think I have a fix, having a testable example was super helpful