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

Requirementslib fails to resolve dependency with relative path and working directory mismatch #306

Open
PythonCoderAS opened this issue Dec 24, 2021 · 3 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@PythonCoderAS
Copy link

As discussed in pypa/pipenv#4900, Requirementslib has an issue when the given relative path and the working directory are different. For example, if the working directory is changed to something other than where the python script is executed, but the relative path is relative to where the script was executed, Requirementslib will fail resolving the requirement.

While it might make sense as to why it's impossible to do so, I wish that the error message was worded clearer and not so crypticly.

@matteius matteius self-assigned this Jun 28, 2022
@matteius
Copy link
Collaborator

@PythonCoderAS I am wondering if this change fixes the issue you have been describing or if you are describing something different: https://github.com/sarugaku/requirementslib/pull/319/files

@PythonCoderAS
Copy link
Author

PythonCoderAS commented Jun 28, 2022

@matteius I tried the patch but it did not work. Here is the commands I followed:

virtualenv venv
source venv/bin/activate
pip install pipenv
cd venv/lib/python3.10/site-packages/pipenv/vendor/requirementslib
patch -p1 <<< `curl -s https://github.com/sarugaku/requirementslib/commit/c1678de7661f2a6fe043e100849ca056edd941d6.diff | sed "s/src\/requirementslib\/models/models/g"`
cd "$OLDPWD"
deactivate
source venv/bin/activate # Recognize new pipenv in PATH
pipenv install
git clone https://github.com/sphinx-doc/sphinx.git
cd sphinx
pipenv install . # Errors here

@matteius
Copy link
Collaborator

Thanks for this example @PythonCoderAS -- and if you go up a directory and do it with pipenv install sphinx/ works just fine, so the dot is causing an issue for a regex somewhere it seems. Thanks for checking that other patch which seems to solve a different issue I was checking on. Will take some more investigating to figure out where to patch this in requirementslib.

@matteius matteius added the help wanted Extra attention is needed label Jun 28, 2022
@matteius matteius added the bug Something isn't working label Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants