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

Experiment2 #247

Closed
wants to merge 10 commits into from
Closed

Experiment2 #247

wants to merge 10 commits into from

Conversation

bashtage
Copy link
Contributor

@bashtage bashtage commented Sep 1, 2022

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 1, 2022

In this case, it failed because changing pyproject.toml caused it to use a different cache.

So the issue now is that if we do update pyproject.toml, the cache is invalid and poetry figures out the dependencies again, and then something gets messed up.

@bashtage
Copy link
Contributor Author

bashtage commented Sep 1, 2022

That is also my conclusion

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 1, 2022

That is also my conclusion

One thing to try is to use poetry use system before each poetry command (especially before poetry install) which I think will force everything to get installed into the "system" environment, and avoid having a virtual environment.

@twoertwein
Copy link
Member

twoertwein commented Sep 1, 2022

I think I tested disabling the poetry.lock caching but adding my local poetry.lock: it still failed (but maybe I'm misremembering something)

edit: tested it here dfba485

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 1, 2022

I think I tested disabling the poetry.lock caching but adding my local poetry.lock: it still failed (but maybe I'm misremembering something)

edit: tested it here dfba485

It's the other way that is not working. If the cache is invalid, then the CI is failing.

@twoertwein
Copy link
Member

It's the other way that is not working. If the cache is invalid, then the CI is failing.

In theory, my local poetry.lock should be the same as the cached poetry.lock. When disabled caching and adding my poetry.lock, it should have the same effect - but it would always be a cache hit.

@bashtage
Copy link
Contributor Author

bashtage commented Sep 1, 2022

Trying to skip the cache on windows.

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 1, 2022

Trying to skip the cache on windows.

I tried that last night. It doesn't solve the problem.

The issue here is that if there is no cache, it will fail. If we do get the cache, then it succeeds.

So we need to know that when we have a new version of pyproject.toml, which would affect poetry.lock, and then when we do poetry install, it determines dependencies, places all the packages in the virtual env, but then when we do any other poetry command, it is not using the virtual environment.

@twoertwein
Copy link
Member

Is there a way to download the cached poetry.lock so that we can compare it to a newly generated one?

@bashtage
Copy link
Contributor Author

bashtage commented Sep 1, 2022 via email

@twoertwein
Copy link
Member

twoertwein commented Sep 1, 2022

If you know the location could just cat them.

Would just need to do cat poetry.lock after loading the caching.

edit: well if the cache was still there - which is not the case on windows

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 1, 2022

Is there a way to download the cached poetry.lock so that we can compare it to a newly generated one?

I don't think that it matters. As soon as we update pyproject.toml, there will be no valid cached file, and we'll run into the current problem, because the CI will create a new poetry.lock file.

Also, I think I read on the action for installing poetry that they discovered that caching doesn't work on Windows anyway

@bashtage
Copy link
Contributor Author

bashtage commented Sep 1, 2022 via email

@bashtage
Copy link
Contributor Author

bashtage commented Sep 1, 2022

Pinning poethepoet to 0.16.0 (vs 0.16.1) fixes the problem.

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 1, 2022

Pinning poethepoet to 0.16.0 (vs 0.16.1) fixes the problem.

Oooh. That's good news. I will test in what I'm trying just to be sure.

@twoertwein
Copy link
Member

It might be worth pinning all versions in pyproject.toml (and also the github action versions to their exact version). We will need to update them every now and then but we might be spared a few days of debugging :)

@bashtage
Copy link
Contributor Author

bashtage commented Sep 1, 2022

Closing in favor of #249

@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 1, 2022

Created nat-n/poethepoet#88

@bashtage bashtage deleted the experiment2 branch September 3, 2022 23:27
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

Successfully merging this pull request may close these issues.

None yet

3 participants