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

Release 1.1.6 #11

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b5a82ea
:art: fix clippy warnings
Ousret Nov 11, 2024
f29cd91
:bookmark: bump version to 1.1.6 and pyo3 main to 0.22.6
Ousret Nov 11, 2024
08f63fa
:arrow_up: upgrade CI.yml dependencies and OS targets
Ousret Nov 11, 2024
5bc95c6
:wrench: add freethreaded build in CI
Ousret Nov 11, 2024
feeded8
:sparkle: add freethreaded patch
Ousret Nov 11, 2024
7fcf4ba
:pencil: write changelog
Ousret Nov 11, 2024
7949e85
:wrench: ignore freethreaded patch for pre-commit lints
Ousret Nov 11, 2024
9aaf617
:wrench: stop upgrading embedded pip in CI
Ousret Nov 11, 2024
0ea3cb6
:wrench: change freethreaded setup methods across mac, linux and windows
Ousret Nov 11, 2024
4d9a061
:art: add rust pre-commit hook and reformat lib.rs
Ousret Nov 11, 2024
314301b
:wrench: update freethreaded CI steps
Ousret Nov 11, 2024
b39fa4e
:wrench: update freethreaded CI steps*2
Ousret Nov 11, 2024
6e66325
:wrench: update freethreaded CI steps*3
Ousret Nov 11, 2024
fa22234
:wrench: update freethreaded CI steps*4
Ousret Nov 11, 2024
65695aa
:wrench: update freethreaded CI steps*5
Ousret Nov 11, 2024
958eb22
:wrench: update freethreaded CI steps*6
Ousret Nov 11, 2024
db95e61
:wrench: update freethreaded CI steps*7
Ousret Nov 11, 2024
1aaa0c0
:wrench: update freethreaded CI steps*8
Ousret Nov 11, 2024
c49fd31
:wrench: update freethreaded CI steps*9
Ousret Nov 12, 2024
731749e
:wrench: improve test resiliency with real world ssl tests
Ousret Nov 12, 2024
5edb6e8
:wrench: add cp313t rustup target aarch64 for macos
Ousret Nov 12, 2024
81f1b85
:wrench: change windows archs target for freethreaded
Ousret Nov 12, 2024
3a362fa
:wrench: change build frontend for freethreaded
Ousret Nov 12, 2024
48ef56b
:wrench: give up on freethreaded windows for now
Ousret Nov 12, 2024
3f4c70e
:wrench: attempt to setup 3.13t within normal linux CI
Ousret Nov 12, 2024
300fb9a
:wrench: attempt to setup 3.13t within normal CI*2
Ousret Nov 12, 2024
eb622f3
:wrench: attempt to setup 3.13t within normal CI*3
Ousret Nov 12, 2024
f7d6824
:wrench: attempt to setup 3.13t within normal CI*5
Ousret Nov 12, 2024
4f30fba
:wrench: attempt to setup 3.13t within normal CI*6
Ousret Nov 12, 2024
a826a63
:wrench: attempt to setup 3.13t within normal CI*7
Ousret Nov 16, 2024
c8a0756
:wrench: attempt to setup 3.13t within normal CI*8
Ousret Nov 16, 2024
c3e0b7c
:wrench: attempt to setup 3.13t within normal CI*9
Ousret Nov 20, 2024
c894dd9
:wrench: attempt to setup 3.13t within normal CI*10
Ousret Nov 20, 2024
2dc526b
:wrench: attempt to setup 3.13t within normal CI*11
Ousret Nov 20, 2024
621f763
:arrow_up: upgrade to pyo3 0.23.1
Ousret Nov 20, 2024
5e85c24
:wrench: update freethreaded patch
Ousret Nov 20, 2024
23ba35f
:arrow_up: upgrade pyo3+maturin for freethreaded support
Ousret Nov 27, 2024
cfe2de1
:arrow_up: pyo3 killed pypy 3.7 and 3.8 support
Ousret Nov 27, 2024
b2f4e5d
:arrow_up: linux build force 3.13t location
Ousret Nov 27, 2024
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
67 changes: 44 additions & 23 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- run: pip install pre-commit
name: Install pre-commit
- run: pre-commit run --all
Expand All @@ -33,17 +33,20 @@ jobs:
test:
strategy:
matrix:
os: [ubuntu-22.04, macos-12, windows-latest ]
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']
os: [ubuntu-22.04, macos-13, windows-latest ]
python_version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
exclude:
- python_version: 3.7
os: macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
allow-prereleases: true
- name: Setup dependencies
run: pip install --upgrade pip pytest
run: pip install pytest
- name: Install mkcert (Linux)
if: matrix.os == 'ubuntu-22.04'
run: sudo apt-get install mkcert
Expand Down Expand Up @@ -90,7 +93,7 @@ jobs:
fail-fast: false
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le, ppc64, i686]
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10']
python_version: ['3.10', 'pypy-3.9', 'pypy-3.10', '3.13t']
manylinux: ['auto', 'musllinux_1_1']
exclude:
- manylinux: musllinux_1_1
Expand All @@ -101,15 +104,20 @@ jobs:
target: ppc64le

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
if: matrix.python_version != '3.13t'
with:
python-version: ${{ matrix.python_version }}
- uses: Quansight-Labs/setup-python@v5
if: matrix.python_version == '3.13t'
with:
python-version: '3.13t'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --interpreter ${{ matrix.python_version }}
args: --release --out dist --interpreter ${{ matrix.python_version == '3.13t' && '/opt/python/cp313-cp313t/bin/python' || matrix.python_version }}
sccache: 'true'
manylinux: ${{ matrix.manylinux }}
- name: Upload wheels
Expand All @@ -127,7 +135,7 @@ jobs:
fail-fast: false
matrix:
target: [x64, aarch64]
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10']
python_version: ['3.10', 'pypy-3.9', 'pypy-3.10', '3.13t']
exclude:
- target: aarch64
python_version: 'pypy-3.7'
Expand All @@ -137,12 +145,20 @@ jobs:
python_version: 'pypy-3.9'
- target: aarch64
python_version: 'pypy-3.10'
- target: aarch64
python_version: '3.13t'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
if: matrix.python_version != '3.13t'
with:
python-version: ${{ matrix.python_version }}
architecture: x64
- uses: Quansight-Labs/setup-python@v5
if: matrix.python_version == '3.13t'
with:
python-version: '3.13t'
architecture: x64
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -159,22 +175,27 @@ jobs:
needs:
- test
- lint
runs-on: macos-12
runs-on: macos-13
strategy:
fail-fast: false
matrix:
target: [x86_64, aarch64, universal2]
python_version: ['3.10', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9', 'pypy-3.10']
python_version: ['3.10', 'pypy-3.9', 'pypy-3.10', '3.13t']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
if: matrix.python_version != '3.13t'
with:
python-version: ${{ matrix.python_version }}
- uses: Quansight-Labs/setup-python@v5
if: matrix.python_version == '3.13t'
with:
python-version: '3.13t'
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --interpreter ${{ matrix.python_version }}
args: --release --out dist
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v3
Expand All @@ -188,7 +209,7 @@ jobs:
- lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
Expand All @@ -206,8 +227,8 @@ jobs:
- lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand Down
18 changes: 17 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exclude: 'docs/|src/'
exclude: 'docs/|freethreaded.patch'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down Expand Up @@ -29,3 +29,19 @@ repos:
- id: mypy
args: [--check-untyped-defs]
exclude: 'tests/'
- repo: local
hooks:
- id: rust-linting
name: Rust linting
description: Run cargo fmt on files included in the commit. rustfmt should be installed before-hand.
entry: cargo fmt --all --
pass_filenames: true
types: [file, rust]
language: system
- id: rust-clippy
name: Rust clippy
description: Run cargo clippy on files included in the commit. clippy should be installed before-hand.
entry: cargo clippy --all-targets --all-features -- -Dclippy::all
pass_filenames: false
types: [file, rust]
language: system
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
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).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 1.1.6 (2024-11-11)

### Changed
- pyo3 updated from 0.22.5 to 0.23.1
- minor improvements in Rust code.

### Added
- Initial support for Python 3.13 freethreaded experimental build.

## 1.1.5 (2024-10-27)

### Changed
Expand Down
38 changes: 19 additions & 19 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wassima"
version = "1.1.5"
version = "1.1.6"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -9,7 +9,7 @@ name = "wassima"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.22.5", features = ["abi3-py37", "extension-module"] }
pyo3 = { version = "0.23.2", features = ["abi3-py37", "extension-module"] }
rustls-native-certs = "0.7.3"

[package.metadata.maturin]
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin>=1.2,<2.0"]
requires = ["maturin>=1.7.5,<2.0"]
build-backend = "maturin"

[project]
Expand Down Expand Up @@ -46,7 +46,7 @@ dependencies = [
"Issue tracker" = "https://github.com/jawah/wassima/issues"

[tool.maturin]
features = ["pyo3/extension-module"]
features = ["pyo3/extension-module", "pyo3/abi3-py37"]
module-name = "wassima._rustls"

[tool.pytest.ini_options]
Expand Down
15 changes: 8 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
use pyo3::{prelude::*, types::PyBytes};
use pyo3::exceptions::PyRuntimeError;
use rustls_native_certs;
use pyo3::{prelude::*, types::PyBytes};

/// Retrieve a list of system DER root CAs
#[pyfunction]
fn root_der_certificates(py: Python) -> PyResult<Vec<Bound<'_, PyBytes, >>> {
fn root_der_certificates(py: Python) -> PyResult<Vec<Bound<'_, PyBytes>>> {
let mut roots = Vec::new();
let certs = rustls_native_certs::load_native_certs();

if certs.is_err() {
return Err(PyRuntimeError::new_err("unable to extract root certificates"));
return Err(PyRuntimeError::new_err(
"unable to extract root certificates",
));
}

for cert in certs.unwrap() {
roots.push(PyBytes::new_bound(py, &cert.as_ref().to_vec()));
roots.push(PyBytes::new(py, cert.as_ref()));
}

return Ok(roots);
Ok(roots)
}

#[pymodule]
#[pymodule(gil_used = false)]
fn _rustls(_py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_function(wrap_pyfunction!(root_der_certificates, m)?)?;
Ok(())
Expand Down
Loading
Loading