Skip to content

Commit

Permalink
Fixup PyPy test issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Dec 4, 2023
1 parent 65c1efd commit f17f72e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
18 changes: 9 additions & 9 deletions docker/base/install_pythons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ PYENV_VERSIONS=(
3.9.18
3.10.13
3.12.0
pypy2.7-7.3.12
pypy2.7-7.3.13
pypy3.5-7.0.0
pypy3.6-7.3.3
pypy3.7-7.3.9
pypy3.8-7.3.11
pypy3.9-7.3.12
pypy3.10-7.3.12
pypy3.9-7.3.13
pypy3.10-7.3.13
)

git clone https://github.com/pyenv/pyenv.git "${PYENV_ROOT}" && (
Expand All @@ -31,13 +31,13 @@ git clone https://github.com/pyenv/pyenv.git "${PYENV_ROOT}" && (
PATH="${PATH}:${PYENV_ROOT}/bin"

for version in "${PYENV_VERSIONS[@]}"; do
if [[ "${version}" == "pypy2.7-7.3.12" ]]; then
# Installation of pypy2.7-7.3.12 fails like so without adjusting the version of get-pip it
if [[ "${version}" == "pypy2.7-7.3.13" ]]; then
# Installation of pypy2.7-7.3.13 fails like so without adjusting the version of get-pip it
# uses:
# $ pyenv install pypy2.7-7.3.12
# Downloading pypy2.7-v7.3.12-linux64.tar.bz2...
# -> https://downloads.python.org/pypy/pypy2.7-v7.3.12-linux64.tar.bz2
# Installing pypy2.7-v7.3.12-linux64...
# $ pyenv install pypy2.7-7.3.13
# Downloading pypy2.7-v7.3.13-linux64.tar.bz2...
# -> https://downloads.python.org/pypy/pypy2.7-v7.3.13-linux64.tar.bz2
# Installing pypy2.7-v7.3.13-linux64...
# Installing pip from https://bootstrap.pypa.io/get-pip.py...
# error: failed to install pip via get-pip.py
# ...
Expand Down
2 changes: 1 addition & 1 deletion pex/pep_427.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def record_files(
)
entry_path = os.path.join(data_path, entry)
copied = [dst for _, dst in iter_copytree(entry_path, dest_dir)]
if "scripts" == entry:
if copied and "scripts" == entry:
for script in copied:
chmod_plus_x(script)
if interpreter:
Expand Down
8 changes: 6 additions & 2 deletions tests/integration/test_pep_427.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pex.pip.installation import get_pip
from pex.typing import TYPE_CHECKING
from pex.venv.virtualenv import Virtualenv
from testing import WheelBuilder
from testing import WheelBuilder, make_env

if TYPE_CHECKING:
from typing import Any
Expand Down Expand Up @@ -103,7 +103,11 @@ def do_some_preprocessing():
assert is_exe(script)

process = subprocess.Popen(
args=[script], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE
args=[script],
env=make_env(TERM=os.environ.get("TERM", "xterm")),
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
stdin=subprocess.PIPE,
)
output, _ = process.communicate()
assert re.match(
Expand Down
4 changes: 2 additions & 2 deletions tests/tools/commands/test_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,5 +257,5 @@ def test_extract_lifecycle(pex, pex_tools_env, tmpdir):
assert -1 * int(signal.SIGTERM) == find_links_server.wait()

expected_output = b"Fetching from https://example.com ...\n"
assert expected_output == subprocess.check_output(args=[example_sdist_pex])
assert expected_output == subprocess.check_output(args=[example_console_script])
assert expected_output in subprocess.check_output(args=[example_sdist_pex])
assert expected_output in subprocess.check_output(args=[example_console_script])
3 changes: 0 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ passenv =
USERNAME
# Needed for tests of git+ssh://...
SSH_AUTH_SOCK
# Needed for interactive tests.
TERM
TERMINFO
setenv =
pip20: _PEX_PIP_VERSION=20.3.4-patched
pip22_2: _PEX_PIP_VERSION=22.2.2
Expand Down

0 comments on commit f17f72e

Please sign in to comment.