-
-
Notifications
You must be signed in to change notification settings - Fork 32
feat: Add Python 3.14 freethreaded support #250
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
Changes from 4 commits
51ca7a0
d6e42b9
4641475
6e6887f
eec8989
67c2ff3
ebc393e
889b14e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,11 +28,11 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [pypy-3.10, pypy-3.11, '3.10', '3.11', '3.12', '3.13', '3.14'] | ||
python-version: [pypy-3.10, pypy-3.11, '3.10', '3.11', '3.12', '3.13', '3.14.0'] | ||
os: [ | ||
ubuntu-latest, | ||
windows-latest, | ||
macos-latest, | ||
ubuntu-22.04, | ||
windows-2022, | ||
macos-14, | ||
] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -142,3 +142,82 @@ jobs: | |
- name: Run mypy | ||
run: mypy json2xml tests | ||
|
||
test-freethreaded: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-22.04 | ||
python-version: '3.14.0' | ||
arch: x64 | ||
platform: linux | ||
- os: windows-2022 | ||
python-version: '3.14.0' | ||
arch: x64 | ||
platform: win32 | ||
- os: macos-14 | ||
python-version: '3.14.0' | ||
arch: x64 | ||
platform: darwin | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Download and setup Python ${{ matrix.python-version }} (freethreaded) | ||
run: | | ||
if [ "${{ matrix.platform }}" = "linux" ]; then | ||
wget -O python.tar.gz "https://github.com/actions/python-versions/releases/download/3.14.0-18313368925/python-3.14.0-linux-22.04-${{ matrix.arch }}-freethreaded.tar.gz" | ||
tar -xzf python.tar.gz | ||
echo "$PWD/python-3.14.0-linux-22.04-${{ matrix.arch }}-freethreaded/bin" >> $GITHUB_PATH | ||
elif [ "${{ matrix.platform }}" = "win32" ]; then | ||
curl -L -o python.zip "https://github.com/actions/python-versions/releases/download/3.14.0-18313368925/python-3.14.0-win32-${{ matrix.arch }}-freethreaded.zip" | ||
Expand-Archive python.zip -DestinationPath . | ||
echo "$PWD/python-3.14.0-win32-${{ matrix.arch }}-freethreaded" >> $env:GITHUB_PATH | ||
elif [ "${{ matrix.platform }}" = "darwin" ]; then | ||
curl -L -o python.tar.gz "https://github.com/actions/python-versions/releases/download/3.14.0-18313368925/python-3.14.0-darwin-${{ matrix.arch }}-freethreaded.tar.gz" | ||
tar -xzf python.tar.gz | ||
echo "$PWD/python-3.14.0-darwin-${{ matrix.arch }}-freethreaded/bin" >> $GITHUB_PATH | ||
fi | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v6 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: | | ||
requirements*.txt | ||
requirements-dev.in | ||
pyproject.toml | ||
|
||
- name: Install dependencies | ||
run: | | ||
uv pip install --system -e . | ||
uv pip install --system pytest pytest-xdist pytest-cov | ||
|
||
- name: Create coverage directory | ||
run: mkdir -p coverage/reports | ||
|
||
- name: Run tests with freethreaded Python | ||
run: | | ||
pytest --cov=json2xml --cov-report=xml:coverage/reports/coverage.xml --cov-report=term -xvs tests -n auto | ||
env: | ||
PYTHONPATH: ${{ github.workspace }} | ||
PYTHON_FREETHREADED: 1 | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha): An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. Source: opengrep |
||
if: success() | ||
with: | ||
directory: ./coverage/reports/ | ||
env_vars: OS,PYTHON | ||
fail_ci_if_error: false # Don't fail CI if codecov upload fails | ||
files: ./coverage/reports/coverage.xml | ||
flags: freethreaded | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: codecov-freethreaded | ||
verbose: true | ||
env: | ||
OS: ${{ matrix.os }} | ||
PYTHON: ${{ matrix.python-version }}-freethreaded | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha): An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
Source: opengrep