From b9223e61e2aec6f2d4841e3fa1f8e5d1ab7e4b61 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 15 Dec 2023 09:37:43 -0500 Subject: [PATCH] Try building py39 wheels to see if that helps with reinitialization errors (#695) --- .github/workflows/wheel-builder.yml | 6 ++++++ README.rst | 6 ++++++ pyproject.toml | 2 +- setup.py | 2 +- src/_bcrypt/Cargo.toml | 2 +- src/_bcrypt/src/lib.rs | 2 +- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/wheel-builder.yml b/.github/workflows/wheel-builder.yml index 2816387e..b7154fe2 100644 --- a/.github/workflows/wheel-builder.yml +++ b/.github/workflows/wheel-builder.yml @@ -41,6 +41,7 @@ jobs: matrix: PYTHON: - { VERSION: "cp37-cp37m", ABI_VERSION: 'cp37' } + - { VERSION: "cp39-cp39", ABI_VERSION: 'cp39' } - { VERSION: "pp39-pypy39_pp73" } - { VERSION: "pp310-pypy310_pp73" } MANYLINUX: @@ -130,6 +131,10 @@ jobs: ABI_VERSION: 'cp37' DOWNLOAD_URL: 'https://www.python.org/ftp/python/3.11.3/python-3.11.3-macos11.pkg' BIN_PATH: '/Library/Frameworks/Python.framework/Versions/3.11/bin/python3' + - VERSION: '3.11' + ABI_VERSION: 'cp39' + DOWNLOAD_URL: 'https://www.python.org/ftp/python/3.11.3/python-3.11.3-macos11.pkg' + BIN_PATH: '/Library/Frameworks/Python.framework/Versions/3.11/bin/python3' name: "Python ${{ matrix.PYTHON.VERSION }} for ABI ${{ matrix.PYTHON.ABI_VERSION }} on macOS" steps: - run: | @@ -179,6 +184,7 @@ jobs: - {ARCH: 'x64', RUST_TRIPLE: 'x86_64-pc-windows-msvc'} PYTHON: - {VERSION: "3.11", ABI_VERSION: "cp37"} + - {VERSION: "3.11", ABI_VERSION: "cp39"} name: "${{ matrix.PYTHON.VERSION }} ${{ matrix.PYTHON.ABI_VERSION }} ${{ matrix.WINDOWS.ARCH }}" steps: - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 diff --git a/README.rst b/README.rst index c92fc2bf..563e3189 100644 --- a/README.rst +++ b/README.rst @@ -51,6 +51,12 @@ While bcrypt remains an acceptable choice for password storage, depending on you Changelog ========= +4.1.2 +----- + +* Publish both ``py37`` and ``py39`` wheels. This should resolve some errors + relating to initializing a module multiple times per process. + 4.1.1 ----- diff --git a/pyproject.toml b/pyproject.toml index 67b6fad4..e365c8c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta" [project] name = "bcrypt" # When updating this, also update lib.rs -version = "4.1.1" +version = "4.1.2" authors = [ {name = "The Python Cryptographic Authority developers", email = "cryptography-dev@python.org"} ] diff --git a/setup.py b/setup.py index 449aa1c2..13694c48 100644 --- a/setup.py +++ b/setup.py @@ -37,7 +37,7 @@ RustExtension( "bcrypt._bcrypt", "src/_bcrypt/Cargo.toml", - py_limited_api=True, + py_limited_api="auto", rust_version=( ">=1.64.0" if os.environ.get("BCRYPT_ALLOW_RUST_163", "0") != "0" diff --git a/src/_bcrypt/Cargo.toml b/src/_bcrypt/Cargo.toml index 6c8f72ad..a9c7f7c6 100644 --- a/src/_bcrypt/Cargo.toml +++ b/src/_bcrypt/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" publish = false [dependencies] -pyo3 = { version = "0.20.0", features = ["abi3-py37"] } +pyo3 = { version = "0.20.0", features = ["abi3"] } bcrypt = "0.15" bcrypt-pbkdf = "0.10.0" base64 = "0.21.5" diff --git a/src/_bcrypt/src/lib.rs b/src/_bcrypt/src/lib.rs index 20479d58..a3472148 100644 --- a/src/_bcrypt/src/lib.rs +++ b/src/_bcrypt/src/lib.rs @@ -185,7 +185,7 @@ fn _bcrypt(_py: pyo3::Python<'_>, m: &pyo3::types::PyModule) -> pyo3::PyResult<( // When updating this, also update pyproject.toml // This isn't named __version__ because passlib treats the existence of // that attribute as proof that we're a different module - m.add("__version_ex__", "4.1.1")?; + m.add("__version_ex__", "4.1.2")?; let author = "The Python Cryptographic Authority developers"; m.add("__author__", author)?;