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

relative paths not handled when installing packages from workplace dependencies (requirements.txt) #82

Open
kristapratico opened this issue Dec 12, 2024 · 2 comments
Labels
bug Issue identified by VS Code Team member as probable bug
Milestone

Comments

@kristapratico
Copy link
Member

kristapratico commented Dec 12, 2024

Python Environments version: 0.1.2024121005

The Azure SDK for Python places each client libraries' dev dependencies in a dev_requirements.txt file, example: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/keyvault/azure-keyvault-keys/dev_requirements.txt

This requirements file contains several relative paths for editable installs of other libraries in the repo. When I create an environment and click the button to install workspace dependencies, I select the dev_requirements.txt for my library, and get an error since the install is run at the root of the repo and doesn't consider the relative paths:

2024-12-11 16:38:52.390 [info] Running: C:\Users\krpratic\azure-sdk-for-python\.venv\Scripts\python.exe -m pip install -r c:\Users\krpratic\azure-sdk-for-python\sdk\openai\azure-openai\dev_requirements.txt
2024-12-11 16:38:54.784 [info] python: ERROR: ../../../tools/azure-sdk-tools is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).
@karthiknadig
Copy link
Member

karthiknadig commented Dec 13, 2024

What is the directory that this should have run in? Is there a way for us to calculate the correct directory from the requirements.txt location.

@kristapratico
Copy link
Member Author

What is the directory that this should have run in? Is there a way for us to calculate the correct directory from the requirements.txt location.

The directory where the dev_requirements.txt file is located, so in the example it should be run from azure-sdk-for-python/sdk/keyvault/azure-keyvault-keys. I think if you wanted to calculate the directory to run the command from you would have crack open the requirements file and resolve the path from any local installs present. There is an issue tracking built-in support for this from pip, but I'm not sure we can rely on that happening soon: pypa/pip#6112

@karthiknadig karthiknadig added this to the January 2025 milestone Dec 16, 2024
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants