-
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
[Draft] Detect Python version using Poetry #30
Conversation
I'm not sure |
@zyv Any idea why CI pipeline is not triggered? |
I understand, but this PR does not install the environment more than running python-poetry-buildpack/bin/compile Line 66 in 7a64a3c
|
It looks like it is pretty useless, as Poetry does not seem to enforce the Python version, so the result would be similar to just executing the same command without |
Could you please explain what is the problem that you are trying to solve here in the first place? Heroku supports following scenarios:
This buildpack doesn't support (2), because it enables random version drift between development and production. Even if your runtime and Heroku runtime match today, tomorrow when Heroku will change the default runtime, redeploying exactly the same code will cause a completely different state to be run - and no-one will notice. In as far as the first option is concerned, we support both possibilities:
Having that said, it is not clear to us what scenario you want to enable with your patch, the implementation notwithstanding. |
No clue, maybe because this is a draft PR, and GitHub doesn't trigger the Actions in this case? |
No, it was a regular PR before I changed it to "draft" because of "draft" in the title. |
@zyv Sure, sorry for not having explained in the first place. Fixing the Python interpreter to a specific version mean having many problems when collaborating with other developers or when a system upgrade happens. Sticking to version Adding a python-poetry-buildpack/bin/compile Lines 78 to 81 in 1650d12
Poetry does not lock the interpreter version either. |
It is possible, it seems that your reading of the code is wrong - please see again my explanation and linked documentation. |
It is not possible to get security patched release "for free" - Heroku doesn't change the runtime of an already deployed application, even upon restarts. You will need to release and re-deploy the application manually after runtime security update has been deployed by Heroku in any case - whether you fix the minor or not doesn't make any difference. |
The approach in the pull request is misguided in that at the time when One could imagine using the system Python and Now that it seems to be a recurring topic, I went ahead and opened an issue asking whether there such an API is available, but failing that the only way to know would be to parse HTML or Markdown files: heroku/heroku-buildpack-python#1181 . The parsing approach has so far been rejected, because it's just way too fragile, complex and laborious. We still support two escape hatches, however, as explained in the documentation: |
@ulgens @stohrendorf thanks for the notice, it seems that a trigger was missing to run CI also on PRs - I've tried to adjust it so that the CI also runs on (external) PRs in addition to pushes and internal PRs, but still runs only once and not multiple times. |
Meanwhile Heroku buildpack added support for querying the latest supported Python version by importing a file with specially defined shell variables: heroku/heroku-buildpack-python#1181 (comment) https://raw.githubusercontent.com/heroku/heroku-buildpack-python/main/bin/default_pythons So we could in theory write the latest minor version per major version into
… but at least, it’s a possibility now. |
It is useful to use prefixes like
^
and~
when requiring a Python version, without picking a specific minor release. As Poetry needs to be installed and fully working, why don't rely on it to detect which Python version satisfies such requirement automatically?