Skip to content

Commit

Permalink
Ensure CI buildPython has different micro versions to the runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Nov 27, 2023
1 parent 8b07806 commit 5eb1265
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 35 deletions.
32 changes: 14 additions & 18 deletions .github/actions/setup-python/action.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
name: Setup Python
description:

inputs:
extra-versions:
description: |
Additional versions to install, on top of the supported runtime versions. One
version per line, in the same syntax as the standard setup-python action.
runs:
using: composite
steps:
- name: List runtime versions
id: runtime-versions
shell: bash
run: |
(
echo "versions<<EOF"
target/list-versions.py --minor
echo EOF
) >> $GITHUB_OUTPUT
- uses: actions/setup-python@v4.6.1
with:
# This should include all major.minor versions supported by the runtime, plus
# OLD_BUILD_PYTHON_VERSION, MIN_BUILD_PYTHON_VERSION and
# MAX_BUILD_PYTHON_VERSION from test_gradle_plugin.
#
# However, the micro versions should be different to those used by the runtime,
# because that's required by the integration tests `requires_python` and
# `marker_python_version`.
python-version: |
${{ steps.runtime-versions.outputs.versions }}
${{ inputs.extra-versions }}
3.6.15
3.7.17
3.8.17
3.9.17
3.10.12
3.11.6
3.12.0
- name: Set default Python command
id: python-default
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ jobs:
- uses: smorimoto/tune-github-hosted-runner-network@v1
- uses: actions/checkout@v3.5.3

- uses: actions/setup-python@v4.6.1
with:
# MIN_BUILD_PYTHON_VERSION from test_gradle_plugin
python-version: 3.7
- uses: ./.github/actions/setup-python

- uses: ./.github/actions/create-local-properties

Expand Down Expand Up @@ -163,9 +160,8 @@ jobs:
agp-version: ${{ fromJSON(needs.product.outputs.agp-versions) }}
os: [linux, macos, windows]
include:
# We pin specific OS versions to ensure that the Python `extra-versions`
# listed below are all available. To avoid clutter in the GitHub UI, OS
# versions are not added to the `os` dimension directly.
# To avoid clutter in the GitHub UI, OS versions are not added to the `os`
# dimension directly.
- os: linux
runs-on: ubuntu-20.04
- os: macos
Expand All @@ -180,13 +176,6 @@ jobs:

- uses: ./.github/actions/setup-python
id: setup-python
with:
# This should include OLD_BUILD_PYTHON_VERSION, MIN_BUILD_PYTHON_VERSION and
# MAX_BUILD_PYTHON_VERSION from test_gradle_plugin, if they're not already
# returned by `list-versions.py --minor`.
extra-versions: |
3.6
3.7

- name: Download Maven repository
uses: actions/download-artifact@v3.0.2
Expand Down
4 changes: 2 additions & 2 deletions product/gradle-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ After stable release:

* Update `MAX_BUILD_PYTHON_VERSION` in test_gradle_plugin.py, and run the tests which
use it.
* Update the list of Python versions in .github/actions/setup-python/action.yml.
* Build the demo app with the new version, and check for any warnings other than the
expected ones about .pyc compilation.

Expand All @@ -105,8 +106,7 @@ After stable release:
* Update `testPython` in gradle-plugin/build.gradle, and run the tests.
* In test_gradle_plugin, update `OLD_BUILD_PYTHON_VERSION` and
`MIN_BUILD_PYTHON_VERSION`, and run the tests which use them.
* Check references to `OLD_BUILD_PYTHON_VERSION` and `MIN_BUILD_PYTHON_VERSION` in
ci.yml.
* Update the list of Python versions in .github/actions/setup-python/action.yml.
* Update android.rst.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def list_versions(mode):
.split()[1])
BUILD_PYTHON_VERSION = BUILD_PYTHON_VERSION_FULL.rpartition(".")[0]

# When updating these, consider also updating extra-versions in ci.yml.
# When updating these, consider also updating .github/actions/setup-python/action.yml.
OLD_BUILD_PYTHON_VERSION = "3.6"
MIN_BUILD_PYTHON_VERSION = "3.7"
MAX_BUILD_PYTHON_VERSION = "3.12"
Expand Down

0 comments on commit 5eb1265

Please sign in to comment.