Skip to content

Commit

Permalink
Update tests for removal of python36 from Github Actions hostedtool…
Browse files Browse the repository at this point in the history
…cache (Cherry-pick of pantsbuild#19901) (pantsbuild#19905)

Github Actions recently removed `python3.6` from `/opt/hostedtoolcache`,
which means that our [`pantsbuild/actions/expose-pythons`
action](https://github.com/pantsbuild/actions/blob/main/expose-pythons/action.yml)
does not expose it.

This causes tests which require Python 3.6 to fail
([example](https://github.com/pantsbuild/pants/actions/runs/6265433640/job/17021049356?pr=19894))
on `main` (and in branches).

Co-authored-by: Stu Hood <stuhood@gmail.com>
  • Loading branch information
WorkerPants and stuhood authored Sep 22, 2023
1 parent 31a9cb0 commit 65c5b49
Show file tree
Hide file tree
Showing 7 changed files with 2,261 additions and 1,857 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
ResourcesGeneratorTarget,
)
from pants.core.target_types import rules as core_target_types_rules
from pants.testutil.python_interpreter_selection import skip_unless_python36_present
from pants.testutil.python_interpreter_selection import skip_unless_python38_present
from pants.testutil.python_rule_runner import PythonRuleRunner
from pants.testutil.rule_runner import QueryRule

Expand Down Expand Up @@ -285,21 +285,21 @@ def test_resolve_local_platforms(pex_executable: str, rule_runner: PythonRuleRun
subprocess.run([executable], check=True)


@skip_unless_python36_present
@skip_unless_python38_present
def test_complete_platforms(rule_runner: PythonRuleRunner) -> None:
linux_complete_platform = pkgutil.get_data(__name__, "platform-linux-py36.json")
linux_complete_platform = pkgutil.get_data(__name__, "platform-linux-py38.json")
assert linux_complete_platform is not None

mac_complete_platform = pkgutil.get_data(__name__, "platform-mac-py36.json")
mac_complete_platform = pkgutil.get_data(__name__, "platform-mac-py38.json")
assert mac_complete_platform is not None

rule_runner.write_files(
{
"src/py/project/platform-linux-py36.json": linux_complete_platform,
"src/py/project/platform-mac-py36.json": mac_complete_platform,
"src/py/project/platform-linux-py38.json": linux_complete_platform,
"src/py/project/platform-mac-py38.json": mac_complete_platform,
"src/py/project/BUILD": dedent(
"""\
python_requirement(name="p537", requirements=["p537==1.0.4"])
python_requirement(name="p537", requirements=["p537==1.0.6"])
files(name="platforms", sources=["platform*.json"])
pex_binary(
dependencies=[":p537"],
Expand Down Expand Up @@ -329,8 +329,8 @@ def test_complete_platforms(rule_runner: PythonRuleRunner) -> None:
)
assert sorted(
[
"p537-1.0.4-cp36-cp36m-manylinux1_x86_64.whl",
"p537-1.0.4-cp36-cp36m-macosx_10_13_x86_64.whl",
"p537-1.0.6-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl",
"p537-1.0.6-cp38-cp38-macosx_10_15_x86_64.whl",
]
) == sorted(pex_info["distributions"])

Expand Down
Loading

0 comments on commit 65c5b49

Please sign in to comment.