From 26eb996bd746fc17fe0066e3728394d0002f3e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=84=B1=EB=B2=94=20=28Bang=20Seongbeom=29?= Date: Wed, 4 Feb 2026 02:28:45 +0000 Subject: [PATCH 1/5] Update PyO3 to 0.28 --- Cargo.lock | 75 +++++++++++++----------------------------------------- Cargo.toml | 2 +- src/lib.rs | 2 +- 3 files changed, 20 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 95c208f..14ee9d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,12 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - [[package]] name = "displaydoc" version = "0.2.5" @@ -145,15 +139,6 @@ dependencies = [ "icu_properties", ] -[[package]] -name = "indoc" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" -dependencies = [ - "rustversion", -] - [[package]] name = "libc" version = "0.2.180" @@ -172,15 +157,6 @@ version = "2.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "once_cell" version = "1.21.3" @@ -195,9 +171,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "portable-atomic" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "potential_utf" @@ -219,35 +195,32 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.27.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab53c047fcd1a1d2a8820fe84f05d6be69e9526be40cb03b73f86b6b03e6d87d" +checksum = "fcf3ccafdf54c050be48a3a086d372f77ba6615f5057211607cd30e5ac5cec6d" dependencies = [ - "indoc", "libc", - "memoffset", "once_cell", "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", - "unindent", ] [[package]] name = "pyo3-build-config" -version = "0.27.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b455933107de8642b4487ed26d912c2d899dec6114884214a0b3bb3be9261ea6" +checksum = "972720a441c91fd9c49f212a1d2d74c6e3803b231ebc8d66c51efbd7ccab11c8" dependencies = [ "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.27.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c85c9cbfaddf651b1221594209aed57e9e5cff63c4d11d1feead529b872a089" +checksum = "5994456d9dab8934d600d3867571b6410f24fbd6002570ad56356733eb54859b" dependencies = [ "libc", "pyo3-build-config", @@ -255,9 +228,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.27.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5b10c9bf9888125d917fb4d2ca2d25c8df94c7ab5a52e13313a07e050a3b02" +checksum = "11ce9cc8d81b3c4969748807604d92b4eef363c5bb82b1a1bdb34ec6f1093a18" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -267,9 +240,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.27.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b51720d314836e53327f5871d4c0cfb4fb37cc2c4a11cc71907a86342c40f9" +checksum = "eaf4b60036a154d23282679b658e3cc7d88d3b8c9a40b43824785f232d2e1b98" dependencies = [ "heck", "proc-macro2", @@ -297,9 +270,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -309,9 +282,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -320,15 +293,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" - -[[package]] -name = "rustversion" -version = "1.0.22" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "a96887878f22d7bad8a3b6dc5b7440e0ada9a245242924394987b21cf2210a4c" [[package]] name = "serde" @@ -416,12 +383,6 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" -[[package]] -name = "unindent" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3" - [[package]] name = "url" version = "2.5.8" diff --git a/Cargo.toml b/Cargo.toml index bafa905..c3a1154 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,5 +14,5 @@ categories = ["web-programming"] crate-type = ["cdylib"] [dependencies] -pyo3 = "0.27.2" +pyo3 = "0.28.0" deno_urlpattern = { package = "urlpattern", version = "0.5.2" } diff --git a/src/lib.rs b/src/lib.rs index 9e6e278..d50f5bd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -353,7 +353,7 @@ impl From for Error { } /// A Python module implemented in Rust. -#[pymodule(gil_used = false)] +#[pymodule] mod urlpattern { #[pymodule_export] use super::UrlPattern; From 95423d4b87d69840765aaffa9e9e4a664d251eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=84=B1=EB=B2=94=20=28Bang=20Seongbeom=29?= Date: Sun, 15 Feb 2026 15:50:16 +0000 Subject: [PATCH 2/5] Update CI.yml to to Maturin 1.12.0 --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 71457b7..426c5d8 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,4 +1,4 @@ -# This file is autogenerated by maturin v1.11.5 +# This file is autogenerated by maturin v1.12.0 # To update, run # # maturin generate-ci --pytest github From aec8a6d3f6dda74a9050a3215dedffc42010347f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=84=B1=EB=B2=94=20=28Bang=20Seongbeom=29?= Date: Sun, 15 Feb 2026 16:16:13 +0000 Subject: [PATCH 3/5] Update denoland/rust-urlpattern to 0.6.0 --- Cargo.lock | 40 ++++++++++++++++++++-------------------- Cargo.toml | 2 +- src/lib.rs | 12 ++++++++---- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14ee9d3..8ee5d04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,9 +141,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.180" +version = "0.2.182" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "litemap" @@ -153,9 +153,9 @@ checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" [[package]] name = "memchr" -version = "2.7.6" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "once_cell" @@ -195,9 +195,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf3ccafdf54c050be48a3a086d372f77ba6615f5057211607cd30e5ac5cec6d" +checksum = "14c738662e2181be11cb82487628404254902bb3225d8e9e99c31f3ef82a405c" dependencies = [ "libc", "once_cell", @@ -209,18 +209,18 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972720a441c91fd9c49f212a1d2d74c6e3803b231ebc8d66c51efbd7ccab11c8" +checksum = "f9ca0864a7dd3c133a7f3f020cbff2e12e88420da854c35540fd20ce2d60e435" dependencies = [ "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5994456d9dab8934d600d3867571b6410f24fbd6002570ad56356733eb54859b" +checksum = "9dfc1956b709823164763a34cc42bbfd26b8730afa77809a3df8b94a3ae3b059" dependencies = [ "libc", "pyo3-build-config", @@ -228,9 +228,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ce9cc8d81b3c4969748807604d92b4eef363c5bb82b1a1bdb34ec6f1093a18" +checksum = "29dc660ad948bae134d579661d08033fbb1918f4529c3bbe3257a68f2009ddf2" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -240,9 +240,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf4b60036a154d23282679b658e3cc7d88d3b8c9a40b43824785f232d2e1b98" +checksum = "e78cd6c6d718acfcedf26c3d21fe0f053624368b0d44298c55d7138fde9331f7" dependencies = [ "heck", "proc-macro2", @@ -341,9 +341,9 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "syn" -version = "2.0.114" +version = "2.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +checksum = "6e614ed320ac28113fa64972c4262d5dbc89deacdfd00c34a3e4cea073243c12" dependencies = [ "proc-macro2", "quote", @@ -379,9 +379,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e" [[package]] name = "url" @@ -397,9 +397,9 @@ dependencies = [ [[package]] name = "urlpattern" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ffe0983283c841b6c6e9f116833a0061cc690c0eb67994d65bbdfa5cd3f24e" +checksum = "df16f50ef4cc145211879a3867ba757076b25dfee812040dcb0658bd9ae7904b" dependencies = [ "icu_properties", "regex", diff --git a/Cargo.toml b/Cargo.toml index c3a1154..c356974 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,4 +15,4 @@ crate-type = ["cdylib"] [dependencies] pyo3 = "0.28.0" -deno_urlpattern = { package = "urlpattern", version = "0.5.2" } +deno_urlpattern = { package = "urlpattern", version = "0.6.0" } diff --git a/src/lib.rs b/src/lib.rs index d50f5bd..1dc8f6a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ #![allow(non_snake_case)] +use std::borrow::Cow; use std::collections::HashMap; use pyo3::{ @@ -201,13 +202,13 @@ pub enum UrlPatternInput<'py> { Init(Bound<'py, PyDict>), } -impl<'py> TryFrom> for deno_urlpattern::quirks::StringOrInit { +impl<'py> TryFrom> for deno_urlpattern::quirks::StringOrInit<'static> { type Error = pyo3::PyErr; fn try_from(input: UrlPatternInput<'py>) -> Result { Ok(match input { UrlPatternInput::String(pattern) => { - deno_urlpattern::quirks::StringOrInit::String(pattern) + deno_urlpattern::quirks::StringOrInit::String(Cow::Owned(pattern)) } UrlPatternInput::Init(init) => deno_urlpattern::quirks::StringOrInit::Init( deno_urlpattern::quirks::UrlPatternInit { @@ -254,7 +255,10 @@ impl<'py> TryFrom> for deno_urlpattern::quirks::StringOrIni } pub struct UrlPatternResult { - pub inputs: (deno_urlpattern::quirks::StringOrInit, Option), + pub inputs: ( + deno_urlpattern::quirks::StringOrInit<'static>, + Option, + ), pub protocol: UrlPatternComponentResult, pub username: UrlPatternComponentResult, pub password: UrlPatternComponentResult, @@ -278,7 +282,7 @@ impl<'py> IntoPyObject<'py> for UrlPatternResult { match string_or_init { deno_urlpattern::quirks::StringOrInit::String(string) => { - list.append(string).unwrap(); + list.append(string.into_owned()).unwrap(); } deno_urlpattern::quirks::StringOrInit::Init(init) => { let init_dict = PyDict::new(py); From 839ecbd70b302c0da5d99dd00abcb3d3323aa031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=84=B1=EB=B2=94=20=28Bang=20Seongbeom=29?= Date: Sun, 15 Feb 2026 16:17:20 +0000 Subject: [PATCH 4/5] Bump to 0.1.9 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ee5d04..c5e9a4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -253,7 +253,7 @@ dependencies = [ [[package]] name = "python-urlpattern" -version = "0.1.8" +version = "0.1.9" dependencies = [ "pyo3", "urlpattern", diff --git a/Cargo.toml b/Cargo.toml index c356974..3ad3677 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "python-urlpattern" -version = "0.1.8" +version = "0.1.9" authors = ["방성범 (Bang Seongbeom) "] edition = "2024" description = "An implementation of the URL Pattern Standard for Python written in Rust." From 27f8dd653af1fbb65f1d14f494d3f0c16cce60f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=84=B1=EB=B2=94=20=28Bang=20Seongbeom=29?= Date: Sun, 15 Feb 2026 16:49:58 +0000 Subject: [PATCH 5/5] Remove pytest from CI.yml addnab/docker-run-action is using old Docker version, which causes the following error: > docker: Error response from daemon: client version 1.41 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version. --- .github/workflows/CI.yml | 74 +--------------------------------------- 1 file changed, 1 insertion(+), 73 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 426c5d8..564ae01 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,7 +1,7 @@ # This file is autogenerated by maturin v1.12.0 # To update, run # -# maturin generate-ci --pytest github +# maturin generate-ci github # name: CI @@ -53,31 +53,6 @@ jobs: with: name: wheels-linux-${{ matrix.platform.target }} path: dist - - name: pytest - if: ${{ startsWith(matrix.platform.target, 'x86_64') }} - shell: bash - run: | - set -e - python3 -m venv .venv - source .venv/bin/activate - pip install urlpattern --find-links dist --force-reinstall - pip install pytest - pytest - - name: pytest - if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }} - uses: uraimo/run-on-arch-action@v2 - with: - arch: ${{ matrix.platform.target }} - distro: ubuntu22.04 - githubToken: ${{ github.token }} - install: | - apt-get update - apt-get install -y --no-install-recommends python3 python3-pip - pip3 install -U pip pytest - run: | - set -e - pip3 install urlpattern --find-links dist --force-reinstall - pytest musllinux: runs-on: ${{ matrix.platform.runner }} @@ -109,36 +84,6 @@ jobs: with: name: wheels-musllinux-${{ matrix.platform.target }} path: dist - - name: pytest - if: ${{ startsWith(matrix.platform.target, 'x86_64') }} - uses: addnab/docker-run-action@v3 - with: - image: alpine:latest - options: -v ${{ github.workspace }}:/io -w /io - run: | - set -e - apk add py3-pip py3-virtualenv - python3 -m virtualenv .venv - source .venv/bin/activate - pip install urlpattern --no-index --find-links dist --force-reinstall - pip install pytest - pytest - - name: pytest - if: ${{ !startsWith(matrix.platform.target, 'x86') }} - uses: uraimo/run-on-arch-action@v2 - with: - arch: ${{ matrix.platform.target }} - distro: alpine_latest - githubToken: ${{ github.token }} - install: | - apk add py3-virtualenv - run: | - set -e - python3 -m virtualenv .venv - source .venv/bin/activate - pip install pytest - pip install urlpattern --find-links dist --force-reinstall - pytest windows: runs-on: ${{ matrix.platform.runner }} @@ -171,15 +116,6 @@ jobs: with: name: wheels-windows-${{ matrix.platform.target }} path: dist - - name: pytest - shell: bash - run: | - set -e - python3 -m venv .venv - source .venv/Scripts/activate - pip install urlpattern --find-links dist --force-reinstall - pip install pytest - pytest macos: runs-on: ${{ matrix.platform.runner }} @@ -206,14 +142,6 @@ jobs: with: name: wheels-macos-${{ matrix.platform.target }} path: dist - - name: pytest - run: | - set -e - python3 -m venv .venv - source .venv/bin/activate - pip install urlpattern --find-links dist --force-reinstall - pip install pytest - pytest sdist: runs-on: ubuntu-latest