Skip to content

[skip changelog] Temporarily full pin Python in all GitHub Actions workflows #1478

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

Merged
merged 1 commit into from
Sep 27, 2021
Merged

[skip changelog] Temporarily full pin Python in all GitHub Actions workflows #1478

merged 1 commit into from
Sep 27, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Sep 27, 2021

Please check if the PR fulfills these requirements

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • What kind of change does this PR introduce?

Bug fix

  • What is the current behavior?

A bug introduced in the 3.9.7 release of Python causes a spurious failure of the
test\test_lib.py::test_install_git_invalid_library integration test:
https://bugs.python.org/issue45121

As a workaround, the last working version of Python must be used: 3.9.6. In order to ensure this is done when running the
integration tests locally, this version is specified in the Poetry configuration (#1470). Even though only the integration tests
require this version limitation, the Poetry configuration change affects all processes that use Poetry. Since only the
integration test workflow was adjusted accordingly (#1470), the other workflows using Poetry continued to explicitely install
a version of Python that did not fulfill the version constraints specified in the Poetry configuration. It seems it was
possible for Poetry to find a compatible version on the runner:

https://github.com/per1234/arduino-cli/runs/3718711989?check_suite_focus=true#step:11:19 (visible due to debug output having been enabled in my fork)

The currently activated Python version 3.9.7 is not supported by the project (>=3.8, <3.9.7).
Trying to find and use a compatible version.
Using python3.8 (3.8.10)

but this additional output caused a failure of the "Deploy Website" workflow due to expecting only valid JSON as the
output from the siteversion.py script:

https://github.com/arduino/arduino-cli/runs/3701954217?check_suite_focus=true#step:12:1

Error: The template is not valid. Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: T. Path '', line 0, position 0.
  • What is the new behavior?

Even though the other workflows were able to continue to work with the discovered Python 3.8.10, it seems safest avoid
reliance on whatever Python the runner happens to have installed and instead explicitly install the Python version we
want to be used. So the full pin of Python is done in all workflows that use Poetry.

No breaking change

  • Other information:

Since it is convenient to get automatic updates for Python patch releases, this full pin should be reverted back to the
"3.9" minor version pin once a new version of Python is released with the bug fixed and added to versions available for
installation via the actions/setup-python GitHub Actions action.

…rkflows

A bug introduced in the 3.9.7 release of Python causes a spurious failure of the
`test\test_lib.py::test_install_git_invalid_library` integration test:
https://bugs.python.org/issue45121

As a workaround, the last working version of Python must be used: 3.9.6. In order to ensure this is done when running the
integration tests locally, this version is specified in the Poetry configuration. Even though only the integration tests
require this version limitation, the Poetry configuration change affects all processes that use Poetry. Since only the
integration test workflow was adjusted accordingly, the other workflows using Poetry continued to explicitely install
a version of Python that did not fulfill the version constraints specified in the Poetry configuration. It seems it was
possible for Poetry to find a compatible version on the runner:

> The currently activated Python version 3.9.7 is not supported by the project (>=3.8, <3.9.7).
> Trying to find and use a compatible version.
> Using python3.8 (3.8.10)

but this additional output caused a failure of the "Deploy Website" workflow due to expecting only valid JSON as the
output from the siteversion.py script:

```
Error: The template is not valid. Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: T. Path '', line 0, position 0.
```

Even though the other workflows were able to continue to work with the discovered Python 3.8.10, it seems safest avoid
reliance on whatever Python the runner happens to have installed and instead explicitly install the Python version we
want to be used. So the full pin of Python is done in all workflows that use Poetry.

Since it is convenient to get automatic updates for Python patch releases, this full pin should be reverted back to the
"3.9" minor version pin once a new version of Python is released with the bug fixed and added to versions available for
installation via the `actions/setup-python` GitHub Actions action.
@per1234 per1234 added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Sep 27, 2021
@per1234 per1234 merged commit 4708cde into arduino:master Sep 27, 2021
@per1234 per1234 deleted the full-pin-python branch September 27, 2021 17:21
@per1234 per1234 self-assigned this Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants