Skip to content

Commit dcb6071

Browse files
committed
Support free-threaded Python 3.13
1 parent 5a0b1db commit dcb6071

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
PYTHON:
1717
- {VERSION: "3.7", TOXENV: "py37"}
1818
- {VERSION: "3.13", TOXENV: "py313"}
19+
- {VERSION: "3.13t", TOXENV: "py313t"}
1920
MACOS:
2021
- macos-13
2122
- macos-latest
@@ -29,7 +30,7 @@ jobs:
2930
- uses: actions/[email protected]
3031
- name: Setup python
3132
id: setup-python
32-
uses: actions/setup-python@v5.3.0
33+
uses: quansight-labs/setup-python@5.3.1
3334
with:
3435
python-version: ${{ matrix.PYTHON.VERSION }}
3536
- uses: actions/[email protected]
@@ -58,12 +59,13 @@ jobs:
5859
PYTHON:
5960
- {VERSION: "3.7", TOXENV: "py37"}
6061
- {VERSION: "3.13", TOXENV: "py313"}
62+
- {VERSION: "3.13t", TOXENV: "py313t"}
6163
name: "Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.WINDOWS.WINDOWS }}"
6264
steps:
6365
- uses: actions/[email protected]
6466
- name: Setup python
6567
id: setup-python
66-
uses: actions/setup-python@v5.3.0
68+
uses: quansight-labs/setup-python@5.3.1
6769
with:
6870
python-version: ${{ matrix.PYTHON.VERSION }}
6971
architecture: ${{ matrix.WINDOWS.ARCH }}
@@ -98,6 +100,7 @@ jobs:
98100
- {VERSION: "3.11", TOXENV: "py311"}
99101
- {VERSION: "3.12", TOXENV: "py312"}
100102
- {VERSION: "3.13", TOXENV: "py313"}
103+
- {VERSION: "3.13", TOXENV: "py313t"}
101104
- {VERSION: "pypy-3.9", TOXENV: "pypy3"}
102105
- {VERSION: "pypy-3.10", TOXENV: "pypy3"}
103106

@@ -110,7 +113,7 @@ jobs:
110113
- uses: actions/[email protected]
111114
- name: Setup python
112115
id: setup-python
113-
uses: actions/setup-python@v5.3.0
116+
uses: quansight-labs/setup-python@5.3.1
114117
with:
115118
python-version: ${{ matrix.PYTHON.VERSION }}
116119
- uses: actions/[email protected]

src/_bcrypt/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn kdf<'p>(
182182
})
183183
}
184184

185-
#[pyo3::pymodule]
185+
#[pyo3::pymodule(gil_used = false)]
186186
mod _bcrypt {
187187
use pyo3::types::PyModuleMethods;
188188

tests/test_bcrypt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ def test_kdf_no_warn_rounds():
464464
bcrypt.kdf(b"password", b"salt", 10, 10, True)
465465

466466

467+
@pytest.mark.thread_unsafe()
467468
def test_kdf_warn_rounds():
468469
with pytest.warns(UserWarning):
469470
bcrypt.kdf(b"password", b"salt", 10, 10)

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ extras =
66
tests
77
deps =
88
coverage
9+
pytest-run-parallel
910
passenv =
1011
RUSTUP_HOME
1112
commands =
12-
coverage run -m pytest --strict-markers {posargs}
13+
coverage run -m pytest --parallel-threads=10 --strict-markers {posargs}
1314
coverage combine
1415
coverage report -m --fail-under 100
1516

0 commit comments

Comments
 (0)