Skip to content

Commit

Permalink
Add devpi use to CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Jul 27, 2023
1 parent a8b783f commit 0bc5343
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defaults:
run:
shell: bash
env:
_PEX_TEST_PYENV_ROOT: .pyenv_test
_PEX_TEST_DEV_ROOT: .pyenv_test
# We use this to skip exposing same-versioned Pythons present on Linux hosts. These otherwise can
# collide when attempting to load libpython<major>.<minor><flags>.so and lead to mysterious errors
# importing builtins like `fcntl` as outlined in https://github.com/pantsbuild/pex/issues/1391.
Expand Down Expand Up @@ -264,7 +264,7 @@ jobs:
uses: pantsbuild/actions/run-tox@addae8ed8cce2b0a359f447d1bb2ec69ff18f9ca
with:
python: ${{ matrix.tox-env-python }}
tox-env: py${{ matrix.python-version[0] }}${{ matrix.python-version[1] }}-pip${{ matrix.pip-version }}-integration
tox-env: py${{ matrix.python-version[0] }}${{ matrix.python-version[1] }}-pip${{ matrix.pip-version }}-integration -- --devpi --shutdown-devpi -vvs
cpython-integration-tests-legacy:
name: (${{ matrix.os }}) Pip ${{ matrix.pip-version }} TOXENV=py${{ matrix.python-version[0] }}${{ matrix.python-version[1] }}-integration
needs: org-check
Expand Down Expand Up @@ -321,7 +321,7 @@ jobs:
- name: Run Integration Tests
run: |
pip install -U tox
tox -e py${{ matrix.python-version[0] }}${{ matrix.python-version[1] }}-pip${{ matrix.pip-version }}-integration
tox -e py${{ matrix.python-version[0] }}${{ matrix.python-version[1] }}-pip${{ matrix.pip-version }}-integration -- --devpi --shutdown-devpi -vvs
pypy-integration-tests:
name: (PyPy ${{ join(matrix.pypy-version, '.') }}) Pip ${{ matrix.pip-version }} TOXENV=pypy${{ join(matrix.pypy-version, '') }}-integration
needs: org-check
Expand Down Expand Up @@ -383,7 +383,7 @@ jobs:
- name: Run Integration Tests
uses: pantsbuild/actions/run-tox@e63d2d0e3c339bdffbe5e51e7c39550e3bc527bb
with:
tox-env: pypy${{ join(matrix.pypy-version, '') }}-pip${{ matrix.pip-version }}-integration
tox-env: pypy${{ join(matrix.pypy-version, '') }}-pip${{ matrix.pip-version }}-integration -- --devpi --shutdown-devpi -vvs
final-status:
name: Gather Final Status
needs:
Expand Down
4 changes: 2 additions & 2 deletions pex/venv/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,10 @@ def sys_executable_paths():
"__PEX_UNVENDORED__",
# These are _not_ used at runtime, but are present under testing / CI and
# simplest to add an exception for here and not warn about in CI runs.
"_PEX_TEST_PYENV_ROOT",
"_PEX_PIP_VERSION",
"_PEX_TEST_PROJECT_DIR",
"_PEX_TEST_DEFAULT_INDEX",
"_PEX_TEST_DEV_ROOT",
"_PEX_TEST_PROJECT_DIR",
# This is used by Pex's Pip to inject runtime patches dynamically.
"_PEX_PIP_RUNTIME_PATCHES_PACKAGE",
# These are used by Pex's Pip venv to provide foreign platform support and work
Expand Down
10 changes: 4 additions & 6 deletions testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,17 +480,15 @@ def bootstrap_python_installer(dest):
}


PEX_TEST_DEV_ROOT = os.path.expanduser(os.environ.get("_PEX_TEST_DEV_ROOT", "~/.pex_dev"))


def ensure_python_distribution(version):
# type: (str) -> Tuple[str, str, str, Callable[[Iterable[str]], Text]]
if version not in ALL_PY_VERSIONS:
raise ValueError("Please constrain version to one of {}".format(ALL_PY_VERSIONS))

pyenv_root = os.path.abspath(
os.path.join(
os.path.expanduser(os.environ.get("_PEX_TEST_PYENV_ROOT", "~/.pex_dev")),
"pyenv",
)
)
pyenv_root = os.path.abspath(os.path.join(PEX_TEST_DEV_ROOT, "pyenv"))
interpreter_location = os.path.join(pyenv_root, "versions", version)

pyenv = os.path.join(pyenv_root, "bin", "pyenv")
Expand Down
3 changes: 2 additions & 1 deletion testing/devpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from pex.interpreter_constraints import InterpreterConstraint
from pex.typing import TYPE_CHECKING
from pex.venv.virtualenv import InvalidVirtualenvError, Virtualenv
from testing import PEX_TEST_DEV_ROOT

if TYPE_CHECKING:
from typing import List, Optional
Expand All @@ -30,7 +31,7 @@
logger = logging.getLogger(__name__)


DEVPI_DIR = os.path.join(os.path.expanduser("~"), ".pex_dev", "devpi")
DEVPI_DIR = os.path.join(PEX_TEST_DEV_ROOT, "devpi")


@attr.s(frozen=True)
Expand Down

0 comments on commit 0bc5343

Please sign in to comment.