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

Allow users to install a project's dependencies, without the project itself #4028

Open
charliermarsh opened this issue Jun 4, 2024 · 7 comments
Labels
preview Experimental behavior

Comments

@charliermarsh
Copy link
Member

Not sure if we want this -- it's like Poetry's --no-root. Let's wait and see if we can find motivating use-cases for it. Poetry also has this concept of "operating modes" which toggle this automatically.

@charliermarsh charliermarsh added the preview Experimental behavior label Jun 4, 2024
@charliermarsh
Copy link
Member Author

(Not decided, filed to revisit later.)

@zanieb
Copy link
Member

zanieb commented Jun 4, 2024

Lots of prior chatter over in python-poetry/poetry#800

@kdebrab
Copy link

kdebrab commented Jun 6, 2024

Maybe see also pypa/pip#11440 for potential use cases.

@charliermarsh
Copy link
Member Author

(Interestingly, we actually kind of already support what's described in that issue because we allow pip install -r pyproject.toml. But that's separate from this issue.)

@kdebrab
Copy link

kdebrab commented Jun 19, 2024

(Interestingly, we actually kind of already support what's described in that issue because we allow pip install -r pyproject.toml. But that's separate from this issue.)

That doesn't support the [extras] syntax (e.g. pip install -r pyproject.toml[doc])?

Personally, I'd love to see support for the syntax suggested here:

pip install --only-deps  .[doc]  # project.dependencies and project.optional-dependencies.doc

[EDIT]
Just discovered that pip install -r pyproject.toml --extra doc gives the functionality I was looking for. That's really great!

@firtrfl
Copy link

firtrfl commented Jun 26, 2024

This works great pip install -r pyproject.toml :) It would be still great to add a flag and also add it to the pyproject.toml

[tool.uv]
package-mode = false

So it would also work with uv add <package>. Many things that I work on are not packages, but it would still be great to use uv to manage dependencies.

PS: uv is such an amazing tool - thanks for building it ❤️

kdeldycke added a commit to kdeldycke/kevin-deldycke-blog that referenced this issue Jul 13, 2024
@kdeldycke
Copy link

I have a use case for that: my blog, which is cirtually Markdown content only, and that is built by Pelican, a pure Python static website generator.

In that case the package-mode = false from Poetry was handy.

In the mean time, I hacked the process and added a dummy package at the root of my repository:

$ ls -lah ./blog
Permissions Size User Date Modified    Name
drwxr-xr-x     - kde  2024-07-13 14:12  .
drwxr-xr-x@    - kde  2024-07-13 14:17  ..
.rw-r--r--     0 kde  2024-07-13 14:11  __init__.py

And added the following directive in pyproject.toml:

[tool.setuptools.packages.find]
include = ["blog"]

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

No branches or pull requests

5 participants