-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 to specify the source when adding a package #1886
Comments
I'm working on a PR, the solution seems to be very easy in the end. |
I think it was intentionally delayed for the version 1.1. Apparently the commit is still present in the branch |
This already added for |
Hi, it looks like this was never implemented or I'm maybe missing something? We have a use case where a custom package bears the same name as a public PyPi package and specifying the source when running |
@GuillaumeLegoy You probably should use something like devpi and configure it correctly so that private packages are preferred over public ones (PyPI). This is the only correct way of dealing with such cases in the end. A lot of background information in this discussion if you are interested. |
Thanks will take a look. However it doesn't answer the above question as it looks like it was implemented but somehow never made it to live? |
I have poetry 1.1.4 and I can see the
In Python packaging world, this is not a real thing as far as I understood. There can not be priorities between indexes. Poetry might offer this, but in general the packaging ecosystem was not built to allow this (for example pip does not allow ordering the indexes), so I would not recommend relying on this too much. See also more details in /~https://github.com/python-poetry/poetry/issues/3269. From my point of view a well configured private index (devpi or other), is a much better solution that will work with any tool (poetry, pip, etc.).
I don't think I ever seriously experimented with this. Indeed poetry claims to support a single primary index plus multiple secondary indexes (which I assume means that distributions are searched in the primary first, and if it fails in the secondary ones). So if that does not work as expected it might be a poetry bug. Maybe there are already tickets on this, if not feel free to open a bug tracking ticket. |
@sinoroc you are right, I see the tag as well. It's not in the doc yet (might go ahead and submit a PR!). Thanks for the info, it was really helpful, appreciate it! |
Anybody have thoughts on extending this to This is for the sake of auto-publishing in CI |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
Since Poetry 1.0 we can specify the source of package in the
pyproject.toml
, in order to use another index than PyPI. This is very convenient, but there is no way to specify this when using thepoetry add
command.This is especially inconvenient when you're trying to update an existing private dependency with
poetry add
, as it will erase its source.My suggestion would be to add a
--source
option topoetry add
, taking the name of a source defined in thepyproject.toml
. I don't think adding a package from a source not defined previously should be accepted.The text was updated successfully, but these errors were encountered: