Skip to content

Commit

Permalink
Support free-threaded Python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Nov 25, 2024
1 parent 5a0b1db commit 1d8f655
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
PYTHON:
- {VERSION: "3.7", TOXENV: "py37"}
- {VERSION: "3.13", TOXENV: "py313"}
- {VERSION: "3.13t", TOXENV: "py313t"}
MACOS:
- macos-13
- macos-latest
Expand All @@ -29,7 +30,7 @@ jobs:
- uses: actions/[email protected]
- name: Setup python
id: setup-python
uses: actions/[email protected].0
uses: quansight-labs/[email protected].1
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- uses: actions/[email protected]
Expand Down Expand Up @@ -58,12 +59,13 @@ jobs:
PYTHON:
- {VERSION: "3.7", TOXENV: "py37"}
- {VERSION: "3.13", TOXENV: "py313"}
- {VERSION: "3.13t", TOXENV: "py313t"}
name: "Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.WINDOWS.WINDOWS }}"
steps:
- uses: actions/[email protected]
- name: Setup python
id: setup-python
uses: actions/[email protected].0
uses: quansight-labs/[email protected].1
with:
python-version: ${{ matrix.PYTHON.VERSION }}
architecture: ${{ matrix.WINDOWS.ARCH }}
Expand Down Expand Up @@ -98,6 +100,7 @@ jobs:
- {VERSION: "3.11", TOXENV: "py311"}
- {VERSION: "3.12", TOXENV: "py312"}
- {VERSION: "3.13", TOXENV: "py313"}
- {VERSION: "3.13", TOXENV: "py313t"}
- {VERSION: "pypy-3.9", TOXENV: "pypy3"}
- {VERSION: "pypy-3.10", TOXENV: "pypy3"}

Expand All @@ -110,7 +113,7 @@ jobs:
- uses: actions/[email protected]
- name: Setup python
id: setup-python
uses: actions/[email protected].0
uses: quansight-labs/[email protected].1
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion src/_bcrypt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ fn kdf<'p>(
})
}

#[pyo3::pymodule]
#[pyo3::pymodule(gil_used = false)]
mod _bcrypt {
use pyo3::types::PyModuleMethods;

Expand Down
1 change: 1 addition & 0 deletions tests/test_bcrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ def test_kdf_no_warn_rounds():
bcrypt.kdf(b"password", b"salt", 10, 10, True)


@pytest.mark.thread_unsafe()
def test_kdf_warn_rounds():
with pytest.warns(UserWarning):
bcrypt.kdf(b"password", b"salt", 10, 10)
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ extras =
tests
deps =
coverage
pytest-run-parallel
passenv =
RUSTUP_HOME
commands =
coverage run -m pytest --strict-markers {posargs}
coverage run -m pytest --parallel-threads=10 --strict-markers {posargs}
coverage combine
coverage report -m --fail-under 100

Expand Down

0 comments on commit 1d8f655

Please sign in to comment.