-
Notifications
You must be signed in to change notification settings - Fork 103
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
Update Poetry to 1.8.3 #637
Conversation
✅ Deploy Preview for conda-lock ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thanks so much, the commit structure looks great! |
I know it's not done fully yet but let me know what you think particularly about the failing test (if I should work to fix it or if the functionality is no longer needed). I am also working on adding markers to properly be able to resolve the environment (so new feature but I guess needed to finish this). |
Hi @romain-intel, it looks great so far! The failing test was recently added in #629 so it'd be great to fix that to ensure no regression. Perhaps @sfinkens could help? |
I'll have a look (later today) |
The problem seems to be that I don't know if it makes sense to just handle this extra case in |
Looks like there's one remaining test failure: |
Am back from a quick break so let me try to wrap this up. I know I still need to add environment markers (new feature but seems to be needed to deal with the deps for poetry and create the dev environments). Apart from that, are all the tests ok (I see some failures but not sure if they are flaky/expected). Let me know what else you think is needed on this and I'll get it wrapped up. Thanks for fixing the tests!! |
Thanks so much @romain-intel for all your work on this, and I'm glad you're back! I'm curious why environment markers are necessary. As for what else is needed, I think we'll primarily have to lean on the test suite. Coverage is far from perfect, but hopefully this fixes more bugs than it creates. |
@maresb : it's because of this: For the tests, there are errors that seem to hint at a bad authorization token or something but am not sure it's related to the PR. Maybe I'll try re-running to see if that was flaky so I wasn't sure if there were actual broken tests. I'll check again. Let me know what you think for the first thing. Happy to do the "simpler" solution. |
Thanks for the clarification @romain-intel! To flesh out exactly what the issue is, as I understand it, the current behavior of conda-lock is to ignore PEP 508 environment markers. We dogfood by generating lockfiles for conda-lock using conda-lock itself. The While embarrassing, I think I could tolerate breakage of the dogfood for now. It would be much nicer if we could implement a very basic version of environment specifiers, e.g. something that only supports expressions of the form I agree that it doesn't make much sense, but I believe there is indeed something in the Poetry upgrade that's causing the weird authorization failures, since other PRs are green, e.g. #644. I'll ping the author @jacksmith15 once again in the hopes that he's available to take a look at those auth failures. |
Got it, so to summarize:
|
I suspect there's a miscommunication here. Wouldn't having different envs work around the dogfooding breakage? I'm suggesting to simply break it. Anyways, feel free to do whatever makes sense to you. I have the highest trust in your judgement. |
That's a dangerous proposition :). At any rate, it seems the only actual failure is this: |
This is really weird. Running that test independently on my mac works fine. Let me keep digging. |
@romain-intel, thanks so much for your persistence!!! I believe Poetry's cache was preventing you from being able to reproduce the error locally, so I modified the test to clear the cache. This allowed me to drill down with a debugger. While it was hard to see exactly what was going on, what was clear is that Poetry wants to handle basic auth through the config dictionary, not the URL. Upon stripping the creds from the URL and passing them instead via the config dict, the tests pass. Would you (or anyone else tracking this) be able to critically review my changes? As for an initial self-review:
|
Ah ha! The cache. Of course the cache. Thank you thank you thank you. OK, I'll take a look at the code changes and see if I can add what you describe in your self review. Progress!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look nice :)
return urlunparse(base_url._replace(netloc=base_url.netloc.split("@", 1)[-1])) | ||
return stripped_url(self.base_url) | ||
|
||
@property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: stripped_base_url and stripped_url are the same thing. Do we need/want both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think they are the same. Should have added example values. 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, sorry, I stupidely missed base_url vs url in the arg :(
tests/test_pip_repositories.py
Outdated
with FileLock(to_delete.parent / ".conda_lock.lock"): | ||
yield | ||
# Do another independent check that triggers even if we're in optimized mode | ||
if "pypoetry-conda-lock" in to_delete.parts: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, there's a risk of silent failure if this condition is false. We should fail hard.
Also, what happens if the lockfile doesn't get cleaned up? Will the tests just silently hang waiting for release?
Thanks @romain-intel!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll fail hard. Let me see if I can get something to clean it up better. I suspect they may hang but maybe what we can do is fail hard too (a timeout there) and I can maybe introduce a general cleanup at the end of the whole test.
Since I am so slow, also updated to 1.8.3. Hopefully this is it for this :). |
Thanks so much @romain-intel!!! I'm slow too 🙈 What do you think of this? Can you think of any blockers? It'd be nice to get this merged. One last re-request in terms of auditability would be to rebase so that we have just a single commit that runs nothing other than |
I don't really have time to track it down at the moment, but frustratingly I can't run pytest locally because I get:
At least it works on the CI |
a2e25ec
to
849306c
Compare
…or running vendoring
Command run was vendoring sync -vvv . from the top-level directory. Also ran dos2unix on a few files: - conda_lock/_vendor/poetry/core/_vendor/lark/grammars/* - conda_lock/_vendor/poetry/core/_vendor/fastjsonschema/* to squelch warnings about line endings
849306c
to
870d78e
Compare
(all credit to @maresb -- just copied it over)
OK, I think I made both changes. It is indeed much cleaner :). Let me know what you think. |
Incredible @romain-intel! I audited f43e218 because that's way too much to look at. I reproduced it exactly with the following commands: vendoring sync -vvv .
dos2unix conda_lock/_vendor/poetry/core/_vendor/lark/grammars/*
dos2unix conda_lock/_vendor/poetry/core/_vendor/fastjsonschema/*
dos2unix conda_lock/_vendor/conda/_vendor/boltons/LICENSE
dos2unix conda_lock/_vendor/poetry/core/_vendor/lark/LICENSE I honestly didn't think this was feasible, but incredibly it seems to me like we're done! Thanks so much!!! ❤️ |
whoohoo!! Thanks for merging!!! |
PR conda#637 initially vendored 1.8.2 and dependencies had been updated for that. It then included 1.8.3 which changed some dependencies. This updates the dependencies for 1.8.3. It also fixes an issue with ~= versus = ^ (and therefore relaxes the previous dependencies. Also regenerated the environments/conda-lock.yml file as a result of the modifications on pyproject.toml using `conda-lock --platform linux-64 --platform osx-64 --platform osx-arm64 --platform linux-aarch64 --file=environments/dev-environment.yaml --file=pyproject.toml --lockfile=environments/conda-lock.yml`
Important reference: the version pins here are incorrect and have been fixed in #678. |
Description
Replaces #636 but refactors commits to make it easier to review. Addresses #613
Still todo: