Skip to content

Commit e0d68b5

Browse files
authored
Release 1.2 (#12)
* ⬆️ update rustls-native-certs from 0.7 to 0.8 * 🔧 update pre-commit config * 📝 write changelog for v1.2 * 🔧 ensure test server is killed before test ends
1 parent 85ab751 commit e0d68b5

File tree

8 files changed

+69
-66
lines changed

8 files changed

+69
-66
lines changed

.github/workflows/CI.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ jobs:
3232

3333
test:
3434
strategy:
35+
fail-fast: false
3536
matrix:
3637
os: [ubuntu-22.04, macos-13, windows-latest ]
3738
python_version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10']
38-
exclude:
39-
- python_version: 3.7
40-
os: macos-13
4139
runs-on: ${{ matrix.os }}
4240
steps:
4341
- uses: actions/checkout@v4
@@ -51,13 +49,13 @@ jobs:
5149
if: matrix.os == 'ubuntu-22.04'
5250
run: sudo apt-get install mkcert
5351
- name: Install mkcert (MacOS)
54-
if: matrix.os == 'macos-12'
52+
if: matrix.os == 'macos-13'
5553
run: brew install mkcert
5654
- name: Inject fake CA in TrustStore
57-
if: matrix.os == 'macos-12' || matrix.os == 'ubuntu-22.04'
55+
if: matrix.os == 'macos-13' || matrix.os == 'ubuntu-22.04'
5856
run: mkcert -install
5957
- name: Generate a valid certificate
60-
if: matrix.os == 'macos-12' || matrix.os == 'ubuntu-22.04'
58+
if: matrix.os == 'macos-13' || matrix.os == 'ubuntu-22.04'
6159
run: mkcert example.test
6260
- name: Build wheels (Unix, Linux)
6361
if: matrix.os != 'windows-latest'
@@ -153,9 +151,6 @@ jobs:
153151
python_version: 'pypy-3.9'
154152
- target: aarch64
155153
python_version: 'pypy-3.10'
156-
# known bug pyo3+maturin fail to produce correct wheel
157-
- target: aarch64
158-
python_version: 3.13t
159154
steps:
160155
- uses: actions/checkout@v4
161156
- uses: actions/setup-python@v5
@@ -164,19 +159,28 @@ jobs:
164159
python-version: ${{ matrix.python_version }}
165160
architecture: x64
166161
- uses: Quansight-Labs/setup-python@v5
167-
if: matrix.python_version == '3.13t'
162+
if: matrix.python_version == '3.13t' && matrix.target == 'x64'
168163
with:
169164
python-version: '3.13t'
170165
architecture: x64
171-
- name: Build wheels
166+
- name: Build wheels (normal)
172167
uses: PyO3/maturin-action@v1
168+
if: matrix.python_version != '3.13t' || matrix.target == 'x64'
173169
env:
174170
UNSAFE_PYO3_SKIP_VERSION_CHECK: 1
175-
PYO3_CROSS: ${{ matrix.target == 'aarch64' && '1' || '' }}
176171
with:
177172
target: ${{ matrix.target }}
178173
args: --release --out dist
179174
sccache: 'false'
175+
- name: Build wheels (workaround 3.13t arm64)
176+
uses: PyO3/maturin-action@v1
177+
if: matrix.python_version == '3.13t' && matrix.target == 'aarch64'
178+
env:
179+
PYO3_CROSS: 1
180+
with:
181+
target: ${{ matrix.target }}
182+
args: --release --out dist -i 3.13t
183+
sccache: 'false'
180184
- name: Upload wheels
181185
uses: actions/upload-artifact@v3
182186
with:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repos:
2424
hooks:
2525
- id: flake8
2626
- repo: https://github.com/pre-commit/mirrors-mypy
27-
rev: v1.11.1
27+
rev: v1.14.1
2828
hooks:
2929
- id: mypy
3030
args: [--check-untyped-defs]

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to wassima will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
55

6+
## 1.2.0 (2025-01-12)
7+
8+
### Changed
9+
- pyo3 updated from 0.23.3 to 0.23.4
10+
- rustls-native-certs updated from 0.7 to 0.8
11+
612
## 1.1.6 (2024-12-26)
713

814
### Changed

Cargo.lock

Lines changed: 27 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[package]
22
name = "wassima"
3-
version = "1.1.6"
3+
version = "1.2.0"
44
edition = "2021"
55

66
[lib]
77
name = "wassima"
88
crate-type = ["cdylib"]
99

1010
[dependencies]
11-
pyo3 = { version = "0.23.3", features = ["abi3-py37", "extension-module", "generate-import-lib"] }
12-
rustls-native-certs = "0.7.3"
11+
pyo3 = { version = "0.23.4", features = ["abi3-py37", "extension-module", "generate-import-lib"] }
12+
rustls-native-certs = "0.8.1"
1313

1414
[package.metadata.maturin]
1515
python-source = "wassima"

src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ use pyo3::{prelude::*, types::PyBytes};
55
#[pyfunction]
66
fn root_der_certificates(py: Python) -> PyResult<Vec<Bound<'_, PyBytes>>> {
77
let mut roots = Vec::new();
8-
let certs = rustls_native_certs::load_native_certs();
98

10-
if certs.is_err() {
11-
return Err(PyRuntimeError::new_err(
12-
"unable to extract root certificates",
13-
));
9+
let container = rustls_native_certs::load_native_certs();
10+
11+
if container.certs.is_empty() {
12+
return Err(PyRuntimeError::new_err("Failed to load native cert store"));
1413
}
1514

16-
for cert in certs.unwrap() {
15+
for cert in container.certs {
1716
roots.push(PyBytes::new(py, cert.as_ref()));
1817
}
1918

tests/test_ctx.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,24 @@ def test_ctx_use_system_store(host: str, port: int, expect_failure: bool) -> Non
8989
s.close()
9090

9191

92-
def serve():
92+
def serve(server: http.server.HTTPServer):
9393
context = SSLContext(PROTOCOL_TLS_SERVER)
9494
context.load_cert_chain(
9595
certfile="./example.test.pem", keyfile="./example.test-key.pem"
9696
)
97-
server_address = ("127.0.0.1", 47476)
98-
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
99-
httpd.socket = context.wrap_socket(httpd.socket, server_side=True)
100-
httpd.serve_forever()
97+
98+
server.socket = context.wrap_socket(server.socket, server_side=True)
99+
server.serve_forever()
101100

102101

103102
@pytest.mark.skipif(not exists("./example.test.pem"), reason="test requires mkcert")
104103
def test_ctx_access_local_trusted_root() -> None:
105104
ctx = create_default_ssl_context()
106105

107-
t = threading.Thread(target=serve)
106+
server_address = ("127.0.0.1", 47476)
107+
httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler)
108+
109+
t = threading.Thread(target=serve, args=(httpd,))
108110
t.daemon = True
109111
t.start()
110112

@@ -141,3 +143,5 @@ def test_ctx_access_local_trusted_root() -> None:
141143

142144
assert s.getpeercert() is not None
143145
s.close()
146+
147+
httpd.shutdown()

wassima/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from __future__ import annotations
22

3-
__version__ = "1.1.6"
3+
__version__ = "1.2.0"
44
VERSION = __version__.split(".")

0 commit comments

Comments
 (0)