Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: Add Python v3.12 to the testing #2862

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,21 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: pip install --user ruff
- run: ruff --format=github --select="E,F,PLC,PLE,UP,W,YTT" --ignore="E721,PLC1901,S101,UP031" --target-version=py38 .
- run: ruff --output-format=github --select="ASYNC,E,F,PLC,PLE,UP,W,YTT"
--ignore="E721,PLC1901,S101,UP031" --target-version=py38 .
Tests:
needs: Lint_Python # Lint_Python takes ~5 seconds, so wait for it to pass before running the full matrix of tests.
strategy:
fail-fast: false
max-parallel: 15
matrix:
node: [16.x, 18.x, 20.x]
python: ["3.8", "3.11"]
python: ["3.8", "3.11", "3.12"]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
Expand All @@ -35,17 +36,19 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
env:
PYTHON_VERSION: ${{ matrix.python }} # Why do this?
- name: Install Dependencies
run: |
npm install --no-progress
pip install pytest
pip install --upgrade packaging pytest
- name: Set Windows environment
if: startsWith(matrix.os, 'windows')
run: |
echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
echo 'PYTHONIOENCODING=utf-8' >> $Env:GITHUB_ENV
- name: Run Python tests
run: python -m pytest
# - name: Run doctests with pytest
Expand Down
4 changes: 2 additions & 2 deletions gyp/pylib/gyp/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sys
import threading
import traceback
from distutils.version import StrictVersion
from packaging.version import parse as version_parse
from gyp.common import GypError
from gyp.common import OrderedSet

Expand Down Expand Up @@ -1183,7 +1183,7 @@ def EvalSingleCondition(cond_expr, true_dict, false_dict, phase, variables, buil
else:
ast_code = compile(cond_expr_expanded, "<string>", "eval")
cached_conditions_asts[cond_expr_expanded] = ast_code
env = {"__builtins__": {}, "v": StrictVersion}
env = {"__builtins__": {}, "v": version_parse}
if eval(ast_code, env, variables):
return true_dict
return false_dict
Expand Down
1 change: 1 addition & 0 deletions gyp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dependencies = ["packaging"]

[project.optional-dependencies]
dev = ["flake8", "pytest"]
Expand Down
Loading