-
Notifications
You must be signed in to change notification settings - Fork 87
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
Read Poetry version from poetry.lock #64
Conversation
bbb1334
to
00724f8
Compare
@jacebrowning this is actually a cool idea, my understanding is that you propose the following:
Could you please still
Thanks! |
@zyv your understanding is correct! Is there a way to get the |
I have approved the workflow after you have submitted your PR, so actually it should run after each commit, and it seems that it does so. The warning is fixed however you achieved that (unfortunately, didn't have time to check it out yet), but now (predictably) the tests are failing. |
@zyv I see "workflow requires approval" when I push a new commit: |
Well, that's weird, I guess that I will have to approve the workflows in the PR until it's merged and you become a second-time contributor :) I thought that one approval per PR with these settings is enough. However, you should be able to run these workflows in your own fork without any limitations, and of course also run the tests locally. This is how we develop this buildpack. |
03b3704
to
cb4a8f9
Compare
4f4e170
to
85b6cb2
Compare
@zyv I can't seem to get the tests to run locally, even from the main branch:
So, I'm afraid I have to abandon this proposal for now, but if someone with more context on this project wants to add this feature it would be much appreciated. |
Hmmm, this is very weird. So what is the platform that you are running the tests on? I'm developing on Ubuntu 20.04, and GitHub runners have Ubuntu 22.04 - both seem to be working fine. From your code it looks like as if you were running the tests on macOS. I've tried to switch from bash regex test to portable |
I'm running macOS 13.4.1 and I can't seem to get Python 3.8.1 installed, which seems to be required for the tests:
|
Ah, I see - that explains it. No, Python 3.8.1 should absolutely not be required. In fact, I don't think that any version of Python is required to run the tests. Apparently the tests are broken on macOS, because nobody ever tried to run them there and my shot in the dark seems to not have helped. I'll try to run them on my Mac and see how bad the problem appears to be. The core harness seems to be working, which is already surprising. In general, the buildpack is written in shell, and it's notoriously hard to write really portable POSIX shell code depending only on the interpreter and core utilities. Which is why I was quite happy to get it to work on Linux in the first place and never contemplated porting to macOS, since nobody is using macOS in production in the first place, and lots of nasty surprises will have to be dealt with when considering the BSD userland. But I've already wrote a portable POSIX test harness rendering JUnit reports, so how hard it can be... :-) the teenager zeal has definitively worn off by now after that experience though. Let's see... |
I have fixed unportable |
@zyv thanks for making the I have added a test that passes for me locally:
But it fails on my fork's CI: https://github.com/jacebrowning/python-poetry-buildpack/actions/runs/6018844169/job/16327748151 Any idea why? |
@jacebrowning , well your Could you please update the README? I think we are almost done here, or is there anything else left to do? |
@zyv I'll update the README now. That should be the last piece to mark this ready for review. |
4a381cb
to
b77df81
Compare
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.
@marns93 @felix11h I've cleaned it up now and in as far as I'm concerned, it's good to go.
I think we should consider which way we want to take internally - set a specific version, our rely on the lock detection, but for most users I would assume the expected behaviour would be to use the version from the lock if it's there at all.
We could also consider getting rid of the hardcoded version completely now and just use the latest, if it's neither specified explicitly nor can be inferred from the lock, what do you think?
I think we should use it from
This is a good idea, but I need to think about the consequences. Let's finish this PR as it is and think about this for the future. |
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.
👍 Thanks for participating.
So what is your opinion on removing the hardcoded version altogether and falling back to latest? If you agree, then we can do it in this PR. |
As a user of this buildpack, I would not find that behavior unexpected. For example, I believe But we could also merge this as-is to see what it's like to use in real projects. 😄 |
I agree, we can fall back to latest Poetry version. I think most of the users are using a version where the Poetry version is in the |
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.
Thank you for preparing this! I'm also happy with using "latest" instead of the hard-coded version.
Alright, I have added another commit that should implement this. |
@jacebrowning thank you for your contribution! |
Newer versions of Poetry include the version that was used to create the
poetry.lock
file as a comment in the first line:Using that information, the buildpack can infer the version of Poetry that needs to be installed.