-
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
use of installed packages means poetry lock does not fully respect designated source for dependencies #8328
Comments
probably nothing to do with the cache then, which you can verify by clearing the cache before the next step |
The responsible code is poetry/src/poetry/puzzle/provider.py Lines 312 to 313 in eb74d62
This looks intentional, the comment for
and I see some sense in that, though I also see a case for not doing this. Seems like enough of an edge case that I personally don't care about it! but if any reader does then this should give them a start. |
I see - thanks for the pointer! I confirm that I think there are two issues here:
It's especially troubling that |
if you care about any of this then - by a huge margin - the most likely way to effect change is to submit a merge request. docs updates in particular should be accessible to all. |
I believe I am also running into this issue. I have some custom packages in a private repo, and they were working before upgrading to Poetry 1.5 (using the Now that I've changed the source to I confirmed that changing the source back to |
not even close to being the same thing, please don't hijack this issue. |
For our use case easy switching between private and public repositories for local package development is very important. I'd expect that if I delete the PyPi source from a package definition the next time I call @jclerman Did you maybe have the chance to look into fixing this? |
Hi, no, I haven't had a chance to look into a fix unfortunately. The documentation update at least would be easy, and should probably be done first, but is if course not what we are really after here. |
-vvv
option) and have included the output below. N/AIssue
When I started writing this, I thought the issue was different - now I think I see what's happening.
In a clean project for which
poetry.lock
has never been run before,poetry
works as expected.However, the results of
poetry lock
seem to be influenced by poetry's cache (somehow), since in an existing project, where poetry has successfully donelock
before, it does not seem to be possible to tellpoetry
to limit where it looks for a given dependency.Let's say we have the following
pyproject.toml
in a clean, new project, and thatmy_dep
is only available in private repoprivaterepo
:poetry lock
correctly tells us:But now if we:
pyproject.toml
to indicate the correct source (private_repo
)poetry lock
(completes successfully)poetry install
(this is key!!)pyproject.toml
back to the wrong source (PyPI)poetry lock
Then there is no failure anymore. We get the following clause in the resulting
poetry.lock
:So,
poetry
is seeing the dependency in its local cache (somehow), using that to decide that it's a valid package, but not getting any metadata for it except the version & description - and populating an awfully sparse-lookingpoetry.lock
clause.That means there's no way to tell poetry, once a package has been found and installed (presumably, from any repo) that now we want to install it from a specific private repo - also no way to ensure that we've completely locked down the source for packages that we want to only ever come from our private repo.
I noticed this when trying to upgrade existing projects to the new
poetry
1.5.x style of specifying sources, and not getting failures when I should have been.The text was updated successfully, but these errors were encountered: