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

Support free-threaded Python 3.13 #925

Merged
merged 10 commits into from
Jan 15, 2025
Merged
Changes from 1 commit
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
Next Next commit
Support free-threaded Python 3.13
  • Loading branch information
ngoldbaum committed Jan 14, 2025
commit 87257a247ab465c3b1797c15f6f3039f8579b4bd
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ jobs:
PYTHON:
- {VERSION: "3.8", TOXENV: "py38"}
- {VERSION: "3.13", TOXENV: "py313"}
- {VERSION: "3.13t", TOXENV: "py313t"}
MACOS:
- macos-13
- macos-latest
@@ -24,7 +25,7 @@ jobs:
- uses: actions/checkout@v4.2.2
- name: Setup python
id: setup-python
uses: actions/setup-python@v5.3.0
uses: quansight-labs/setup-python@v5.3.1
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- uses: actions/cache@v4.2.0
@@ -53,12 +54,13 @@ jobs:
PYTHON:
- {VERSION: "3.8", TOXENV: "py38"}
- {VERSION: "3.13", TOXENV: "py313"}
- {VERSION: "3.13t", TOXENV: "py313t"}
name: "Python ${{ matrix.PYTHON.VERSION }} on ${{ matrix.WINDOWS.WINDOWS }}"
steps:
- uses: actions/checkout@v4.2.2
- name: Setup python
id: setup-python
uses: actions/setup-python@v5.3.0
uses: quansight-labs/setup-python@v5.3.1
with:
python-version: ${{ matrix.PYTHON.VERSION }}
architecture: ${{ matrix.WINDOWS.ARCH }}
@@ -92,6 +94,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"}

@@ -104,7 +107,7 @@ jobs:
- uses: actions/checkout@v4.2.2
- name: Setup python
id: setup-python
uses: actions/setup-python@v5.3.0
uses: quansight-labs/setup-python@v5.3.1
with:
python-version: ${{ matrix.PYTHON.VERSION }}
- uses: actions/cache@v4.2.0
2 changes: 1 addition & 1 deletion src/_bcrypt/src/lib.rs
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@ fn kdf<'p>(
})
}

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

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


@pytest.mark.thread_unsafe()
alex marked this conversation as resolved.
Show resolved Hide resolved
def test_kdf_warn_rounds():
with pytest.warns(UserWarning):
bcrypt.kdf(b"password", b"salt", 10, 10)
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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}
ngoldbaum marked this conversation as resolved.
Show resolved Hide resolved
coverage combine
coverage report -m --fail-under 100