Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
pdilyard opened this issue Oct 12, 2018 · 6 comments
Closed

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

pdilyard opened this issue Oct 12, 2018 · 6 comments
Assignees
Labels
Category: VCS Relates to version control system dependencies. Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.

Comments

@pdilyard
Copy link

pdilyard commented Oct 12, 2018

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.
@wolph
Copy link

wolph commented Oct 13, 2018

I can confirm, there's been a pull request to support this in the past: #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.

@techalchemy
Copy link
Member

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

@wolph
Copy link

wolph commented Oct 20, 2018

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.

@pdilyard
Copy link
Author

pdilyard commented Oct 21, 2018

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

@techalchemy
Copy link
Member

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

@techalchemy techalchemy added Type: Bug 🐛 This issue is a bug. Category: VCS Relates to version control system dependencies. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv. labels Oct 22, 2018
techalchemy added a commit that referenced this issue Oct 24, 2018
- Upgrade pythonfinder
- Upgrade vistir
- Upgrade requirementslib
- Vendor backported version of `functools.lru_cache` for performance
- Fix editable dependency installation when markers are present
- Fix extraneous resource warnings
- Fix filesystem output stream encoding issues
- Fix pythonfinder non-standard python name issues
- Provide full interaction layer to `Pipfile` and `Pipfile.lock` in
  requirementslib
- Fixes #3017
- Fixes #3014
- Fixes #3021
- Fixes #3019

Signed-off-by: Dan Ryan <[email protected]>
@techalchemy techalchemy self-assigned this Oct 29, 2018
techalchemy added a commit that referenced this issue Oct 30, 2018
- Upgrade pythonfinder
- Upgrade vistir
- Upgrade requirementslib
- Vendor backported version of `functools.lru_cache` for performance
- Fix editable dependency installation when markers are present
- Fix extraneous resource warnings
- Fix filesystem output stream encoding issues
- Fix pythonfinder non-standard python name issues
- Provide full interaction layer to `Pipfile` and `Pipfile.lock` in
  requirementslib
- Fixes #3017
- Fixes #3014
- Fixes #3021
- Fixes #3019

Signed-off-by: Dan Ryan <[email protected]>

Update vendored dependencies

- Update shellingham, tomlkit, requests, urllib3, certifi, vistir and
  parse
- Fixes #2820
- Fixes #2852

Signed-off-by: Dan Ryan <[email protected]>

Cleanup old vendored dependencies

Signed-off-by: Dan Ryan <[email protected]>
@wolph
Copy link

wolph commented Oct 30, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: VCS Relates to version control system dependencies. Type: Bug 🐛 This issue is a bug. Type: Vendored Dependencies This issue affects vendored dependencies within pipenv.
Projects
None yet
Development

No branches or pull requests

3 participants