Skip to content

Commit

Permalink
Remove tests for buildPython version 2.7, since it's no longer availa…
Browse files Browse the repository at this point in the history
…ble on GitHub Actions
  • Loading branch information
mhsmith committed Jul 20, 2023
1 parent ca5fa21 commit b92518a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 28 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ jobs:
- uses: ./.github/actions/setup-python
id: setup-python
with:
# This should match OLD_BUILD_PYTHON_VERSIONS and MIN_BUILD_PYTHON_VERSION
# This should match OLD_BUILD_PYTHON_VERSION and MIN_BUILD_PYTHON_VERSION
# in test_gradle_plugin.
extra-versions: |
2.7
3.6
3.7
Expand Down
3 changes: 0 additions & 3 deletions product/gradle-plugin/src/main/python/chaquopy/pip_install.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env python3

# Keep valid Python 2 syntax so we can produce an error message.
from __future__ import absolute_import, division, print_function

# Do this as early as possible to minimize the chance of something else going wrong and causing
# a less comprehensible error message.
from .util import check_build_python
Expand Down
3 changes: 0 additions & 3 deletions product/gradle-plugin/src/main/python/chaquopy/pyc.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env python3

# Keep valid Python 2 syntax so we can produce an error message.
from __future__ import absolute_import, division, print_function

# Do this as early as possible to minimize the chance of something else going wrong and causing
# a less comprehensible error message.
from .util import check_build_python
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#!/usr/bin/env python3

# Keep valid Python 2 syntax so we can produce an error message.
from __future__ import absolute_import, division, print_function

# Do this as early as possible to minimize the chance of something else going wrong and causing
# a less comprehensible error message.
from .util import check_build_python
Expand Down
3 changes: 0 additions & 3 deletions product/gradle-plugin/src/main/python/chaquopy/util.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Keep valid Python 2 syntax so we can produce an actionable error message.
from __future__ import absolute_import, division, print_function

import sys


Expand Down
22 changes: 8 additions & 14 deletions product/gradle-plugin/src/test/integration/test_gradle_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ def run_build_python(args, **kwargs):
.split()[1])
BUILD_PYTHON_VERSION = BUILD_PYTHON_VERSION_FULL.rpartition(".")[0]

# These should match `extra-versions` in the ci.yml job `test-integration`. 2.7 is
# included to make sure we've kept valid Python 2 syntax, so we can produce a useful
# error message.
OLD_BUILD_PYTHON_VERSIONS = ["2.7", "3.6"]
# These should match `extra-versions` in the ci.yml job `test-integration`.
OLD_BUILD_PYTHON_VERSION = "3.6"
MIN_BUILD_PYTHON_VERSION = "3.7"

MAX_BUILD_PYTHON_VERSION = "3.11"
Expand Down Expand Up @@ -765,11 +763,9 @@ def test_buildpython(self):
"no_binary_sdist/__init__.py"],
pyc=["stdlib"])

for version in OLD_BUILD_PYTHON_VERSIONS:
with self.subTest(version=version):
run = self.RunGradle(*layers, env={"buildpython_version": version},
succeed=False)
self.assertInLong(BuildPython.old_version_error(version), run.stderr, re=True)
run = self.RunGradle(*layers, env={"buildpython_version": OLD_BUILD_PYTHON_VERSION},
succeed=False)
self.assertInLong(BuildPython.old_version_error(version), run.stderr, re=True)

def test_buildpython_missing(self):
run = self.RunGradle(
Expand Down Expand Up @@ -1427,11 +1423,9 @@ def test_buildpython(self):
classes={"chaquopy_test.a": ["SrcA1"]},
pyc=["stdlib"])

for version in OLD_BUILD_PYTHON_VERSIONS:
with self.subTest(version=version):
run = self.RunGradle(*layers, env={"buildpython_version": version},
succeed=False)
self.assertInLong(BuildPython.old_version_error(version), run.stderr, re=True)
run = self.RunGradle(*layers, env={"buildpython_version": OLD_BUILD_PYTHON_VERSION},
succeed=False)
self.assertInLong(BuildPython.old_version_error(version), run.stderr, re=True)

def test_buildpython_missing(self):
run = self.RunGradle(
Expand Down

0 comments on commit b92518a

Please sign in to comment.