Skip to content

Commit

Permalink
Finalize 3.11 in CI. (pex-tool#1966)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois authored Oct 27, 2022
1 parent 6a97efd commit 22e6515
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 23 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,17 @@ jobs:
python-version: [ 3, 5 ]
pip-version: 20
- os: macos-11
python-version: [ 3, 10 ]
python-version: [ 3, 11 ]
pip-version: 20
- os: ubuntu-20.04
python-version: [ 3, 10 ]
python-version: [ 3, 11 ]
pip-version: 20
- os: ubuntu-20.04
python-version: [ 3, 10 ]
python-version: [ 3, 11 ]
pip-version: 22_2
- os: ubuntu-20.04
python-version: [ 3, 10 ]
python-version: [ 3, 11 ]
pip-version: 22_3
- os: ubuntu-20.04
python-version: [ 3, 11, "0-rc.2" ]
pip-version: 20
steps:
- name: Calculate Pythons to Expose
id: calculate-pythons-to-expose
Expand Down Expand Up @@ -163,20 +160,17 @@ jobs:
python-version: [ 3, 7 ]
pip-version: 22_3
- os: macos-11
python-version: [ 3, 10 ]
python-version: [ 3, 11 ]
pip-version: 20
- os: ubuntu-20.04
python-version: [ 3, 10 ]
python-version: [ 3, 11 ]
pip-version: 20
- os: ubuntu-20.04
python-version: [ 3, 10 ]
python-version: [ 3, 11 ]
pip-version: 22_2
- os: ubuntu-20.04
python-version: [ 3, 10 ]
python-version: [ 3, 11 ]
pip-version: 22_3
- os: ubuntu-20.04
python-version: [ 3, 11, "0-rc.2" ]
pip-version: 20
steps:
- name: Calculate Pythons to Expose
id: calculate-pythons-to-expose
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ needs.determine-tag.outputs.release-tag }}
- name: Setup Python 3.10
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Publish Pex ${{ needs.determine-tag.outputs.release-tag }}
uses: pantsbuild/actions/run-tox@e63d2d0e3c339bdffbe5e51e7c39550e3bc527bb
env:
Expand All @@ -72,10 +72,10 @@ jobs:
ref: ${{ needs.determine-tag.outputs.release-tag }}
# This ensures we get all branches and tags which is needed for `tox -e package`.
fetch-depth: 0
- name: Setup Python 3.10
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"
- name: Package Pex ${{ needs.determine-tag.outputs.release-tag }} PEX
uses: pantsbuild/actions/run-tox@e63d2d0e3c339bdffbe5e51e7c39550e3bc527bb
with:
Expand Down
35 changes: 30 additions & 5 deletions tests/integration/test_setproctitle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
import os.path
import subprocess
import sys
import sysconfig
from textwrap import dedent
from typing import Text

import pytest

from pex import variables
from pex.common import safe_open
from pex.compatibility import commonpath
from pex.interpreter import PythonInterpreter
from pex.layout import Layout
from pex.pex_info import PexInfo
from pex.testing import run_pex_command
from pex.testing import IS_MAC, run_pex_command
from pex.typing import TYPE_CHECKING

if TYPE_CHECKING:
Expand Down Expand Up @@ -90,10 +92,33 @@ def grab_ps(

def assert_expected_python(exe):
# type: (Text) -> None
assert (
PythonInterpreter.get().resolve_base_interpreter()
== PythonInterpreter.from_binary(str(exe)).resolve_base_interpreter()
)
expected = PythonInterpreter.get().resolve_base_interpreter()
actual = PythonInterpreter.from_binary(str(exe)).resolve_base_interpreter()
python_framework = sysconfig.get_config_var("PYTHONFRAMEWORKINSTALLDIR")
if IS_MAC and expected != actual and python_framework:
# Mac framework Python distributions have two Python binaries (starred) as well as
# several symlinks. The layout looks like so:
# /Library/Frameworks/
# Python.framework/ # sysconfig.get_config_var("PYTHONFRAMEWORKINSTALLDIR")
# Versions/X.Y/ # sys.prefix
# bin/
# python -> pythonX.Y
# pythonX -> pythonX.Y
# *pythonX.Y
# Resources/Python.app/
# Contents/MacOS/
# *Python
#
# In some versions of Python, the bin Python, when executed, gets a sys.executable of
# the corresponding Python resource. On others, they each retain a sys.executable
# faithful to their launcher file path. It's the latter type we're working around here.
assert python_framework == commonpath(
(python_framework, expected.binary, actual.binary)
)
assert expected.prefix == actual.prefix
assert expected.version == actual.version
else:
assert expected == actual

pex_file = os.path.join(str(tmpdir), "pex.file")
exe, args = grab_ps(pex_file)
Expand Down

0 comments on commit 22e6515

Please sign in to comment.