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

Second order path dependencies are not handled #2239

Closed
adrienball opened this issue Mar 6, 2024 · 3 comments
Closed

Second order path dependencies are not handled #2239

adrienball opened this issue Mar 6, 2024 · 3 comments

Comments

@adrienball
Copy link

I am facing an issue with second order path dependencies, which I manage to isolate in a simple example.
Let's consider the following project layout:

├── package-1
│   └── setup.py
├── package-2
│   └── setup.py
└── package-3
    └── setup.py

With the following content:

package-1/setup.py

from setuptools import setup

setup(
    name="package-1",
    version="0.1.0"
)

package-2/setup.py

from setuptools import setup, os

setup(
    name="package-2",
    version="0.1.0",
    install_requires=[f"package-1 @ file://{os.getcwd()}/../package-1"],
)

package-3/setup.py

from setuptools import setup, os

setup(
    name="package-3",
    version="0.1.0",
    install_requires=[f"package-2 @ file://{os.getcwd()}/../package-2"],
)

Now if I try to install package-3:

> cd package-3
> uv venv --seed
Using Python 3.9.9 interpreter at: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
Creating virtualenv at: .venv
 + pip==24.0
 + setuptools==69.1.1
 + wheel==0.42.0
Activate with: source .venv/bin/activate
> uv pip install -e .
   Built file:///Users/###/uv-debug/package-3                                                                                                                                                                                                    Built 1 editable in 1.07s
error: Package `package-1` attempted to resolve via URL: file:///Users/###/uv-debug/package-1. URL dependencies must be expressed as direct requirements or constraints. Consider adding `package-1 @ file:///Users/###/uv-debug/package-1` to your dependencies or constraints file.

However if I try to install package-2, it works:

> cd package-2
> uv venv --seed
Using Python 3.9.9 interpreter at: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3
Creating virtualenv at: .venv
 + pip==24.0
 + setuptools==69.1.1
 + wheel==0.42.0
Activate with: source .venv/bin/activate
> uv pip install -e .
   Built file:///Users/###/uv-debug/package-2                                                                                                                                                                                                    Built 1 editable in 1.10s
Resolved 2 packages in 1ms
Installed 2 packages in 5ms
 + package-1==0.1.0 (from file:///Users/###/uv-debug/package-1)
 + package-2==0.1.0 (from file:///Users/###/uv-debug/package-2)

I have no issue if I use pip install -e . instead of uv pip install -e ..

Thanks for your help!

Environment

uv 0.1.15
python 3.9.9
MacOS

@charliermarsh
Copy link
Member

Thanks -- this is by design right now as per the error message: we don't respect arbitrary direct URL dependencies, and instead require that they're declared upfront as first-party dependencies. You can track that behavior here: #1808.

@charliermarsh
Copy link
Member

(Gonna merge into #1808.)

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Mar 6, 2024
@adrienball
Copy link
Author

Thanks for your reactivity :)
I'll keep following for potential updates on #1808 then.
Feel free to close this issue if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants