Bump pyo3 version (#1062)

This commit is contained in:
Alex Gaynor 2025-09-04 06:59:17 -04:00 committed by GitHub
parent 921ea945e2
commit 4c5f16a520
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 26 additions and 18 deletions

View File

@ -47,6 +47,7 @@ jobs:
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
WINDOWS:
- {ARCH: 'x86', WINDOWS: 'win32', RUST_TRIPLE: 'i686-pc-windows-msvc'}
@ -84,6 +85,7 @@ jobs:
linux:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
PYTHON:
- {VERSION: "3.13", NOXSESSION: "pep8,packaging"}
@ -100,7 +102,7 @@ jobs:
- {VERSION: "pypy-3.11", NOXSESSION: "tests"}
# MSRV
- {VERSION: "3.13", NOXSESSION: "tests", RUST_VERSION: "1.64.0"}
- {VERSION: "3.13", NOXSESSION: "tests", RUST_VERSION: "1.74.0"}
- {VERSION: "3.13", NOXSESSION: "tests", RUST_VERSION: "beta"}
- {VERSION: "3.13", NOXSESSION: "tests", RUST_VERSION: "nightly"}
name: "${{ matrix.PYTHON.VERSION }} on linux, Rust ${{ matrix.PYTHON.RUST_VERSION || 'stable' }}"
@ -141,6 +143,7 @@ jobs:
- /staticnodehost/20:/__e/node20:ro,rshared
- /staticnodehost/24:/__e/node24:ro,rshared
strategy:
fail-fast: false
matrix:
IMAGE:
- {IMAGE: "alpine", NOXSESSION: "tests", RUNNER: "ubuntu-latest"}
@ -172,6 +175,7 @@ jobs:
runs-on: ${{ matrix.IMAGE.RUNNER }}
container: ghcr.io/pyca/cryptography-runner-${{ matrix.IMAGE.IMAGE }}
strategy:
fail-fast: false
matrix:
IMAGE:
- {IMAGE: "ubuntu-rolling:aarch64", NOXSESSION: "tests", RUNNER: "ubuntu-24.04-arm"}

View File

@ -51,6 +51,11 @@ While bcrypt remains an acceptable choice for password storage, depending on you
Changelog
=========
Unreleased
----------
* Bumped MSRV to 1.74.
4.3.0
-----

25
src/_bcrypt/Cargo.lock generated
View File

@ -181,9 +181,9 @@ dependencies = [
[[package]]
name = "once_cell"
version = "1.20.3"
version = "1.21.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "pbkdf2"
@ -211,9 +211,9 @@ dependencies = [
[[package]]
name = "pyo3"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383"
dependencies = [
"indoc",
"libc",
@ -228,19 +228,18 @@ dependencies = [
[[package]]
name = "pyo3-build-config"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598"
checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f"
dependencies = [
"once_cell",
"target-lexicon",
]
[[package]]
name = "pyo3-ffi"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c"
checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105"
dependencies = [
"libc",
"pyo3-build-config",
@ -248,9 +247,9 @@ dependencies = [
[[package]]
name = "pyo3-macros"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50"
checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded"
dependencies = [
"proc-macro2",
"pyo3-macros-backend",
@ -260,9 +259,9 @@ dependencies = [
[[package]]
name = "pyo3-macros-backend"
version = "0.25.1"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc"
checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf"
dependencies = [
"heck",
"proc-macro2",

View File

@ -4,11 +4,11 @@ version = "0.1.0"
authors = ["The bcrypt developers <cryptography-dev@python.org>"]
edition = "2018"
# This specifies the MSRV
rust-version = "1.64.0"
rust-version = "1.74.0"
publish = false
[dependencies]
pyo3 = { version = "0.25.1", features = ["abi3"] }
pyo3 = { version = "0.26", features = ["abi3"] }
bcrypt = "0.17"
bcrypt-pbkdf = "0.10.0"
base64 = "0.22.1"

View File

@ -126,7 +126,7 @@ fn hashpw<'p>(
.map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?;
let hashed = py
.allow_threads(|| bcrypt::hash_with_salt(password, cost, raw_salt))
.detach(|| bcrypt::hash_with_salt(password, cost, raw_salt))
.map_err(|_| pyo3::exceptions::PyValueError::new_err("Invalid salt"))?;
Ok(pyo3::types::PyBytes::new(
py,
@ -183,7 +183,7 @@ fn kdf<'p>(
}
pyo3::types::PyBytes::new_with(py, desired_key_bytes, |output| {
py.allow_threads(|| {
py.detach(|| {
bcrypt_pbkdf::bcrypt_pbkdf(password, salt, rounds, output).unwrap();
});
Ok(())