Skip to content

Commit

Permalink
Fix another PyYAML / Cython 3 related bitrot.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Jul 20, 2023
1 parent b2677b2 commit 4ba939a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/integration/test_issue_1316.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

import os
import subprocess
import sys

import pytest

from pex.testing import run_pex_command
from pex.typing import TYPE_CHECKING
Expand All @@ -11,8 +14,19 @@
from typing import Any


@pytest.mark.skipif(sys.version_info[:2] < (3, 6), reason="PyYAML 6.0.1 requires Python >= 3.6")
def test_resolve_cyclic_dependency_graph(tmpdir):
# type: (Any) -> None
naked_pex = os.path.join(str(tmpdir), "naked.pex")
run_pex_command(args=["Naked==0.1.31", "-o", naked_pex]).assert_success()

# N.B.: Naked 0.1.31 requires PyYAML unbounded and old versions of PyYAML that work with Python
# 2.7 have been broken by the Cython 3.0.0 release. As such we exclude older versions of Python
# from this test and pin PyYAML to a newer version that works with Cython>=3.
constraints = os.path.join(str(tmpdir), "constraints.txt")
with open(constraints, "w") as fp:
fp.write("PyYAML==6.0.1")

run_pex_command(
args=["Naked==0.1.31", "--constraints", constraints, "-o", naked_pex]
).assert_success()
subprocess.check_call(args=[naked_pex, "-c", "import Naked"])

0 comments on commit 4ba939a

Please sign in to comment.