From 803300c240cd2c483bc97881c5ebd5a85664eac5 Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 13 Jan 2026 11:24:52 -0600 Subject: [PATCH 1/3] Expose ada_get_version as ada_url.get_version --- ada_url/__init__.py | 2 ++ ada_url/ada_adapter.py | 3 +++ tests/test_ada_url.py | 10 ++++++++++ 3 files changed, 15 insertions(+) diff --git a/ada_url/__init__.py b/ada_url/__init__.py index 1ae6cef..ea161f7 100644 --- a/ada_url/__init__.py +++ b/ada_url/__init__.py @@ -3,6 +3,7 @@ HostType, SchemeType, URLSearchParams, + get_version, check_url, idna, idna_to_ascii, @@ -21,6 +22,7 @@ 'URL', 'URLSearchParams', 'check_url', + 'get_version', 'idna', 'idna_to_ascii', 'idna_to_unicode', diff --git a/ada_url/ada_adapter.py b/ada_url/ada_adapter.py index 0139bcc..3aeaa19 100644 --- a/ada_url/ada_adapter.py +++ b/ada_url/ada_adapter.py @@ -754,3 +754,6 @@ def encode(s: Union[str, bytes]) -> bytes: idna_to_unicode = idna.decode idna_to_ascii = idna.encode + +def get_version(): + return ffi.string(lib.ada_get_version()).decode() diff --git a/tests/test_ada_url.py b/tests/test_ada_url.py index ecfa166..d269b31 100644 --- a/tests/test_ada_url.py +++ b/tests/test_ada_url.py @@ -9,6 +9,7 @@ URLSearchParams as SearchParams, URL, check_url, + get_version, idna, idna_to_ascii, idna_to_unicode, @@ -548,3 +549,12 @@ def test_url_suite(self): else: urlobj = URL(s, base=base) self.assertEqual(urlobj.href, item['href']) + + +class GetVersionTests(TestCase): + def test_get_version(self): + value = get_version() + version_parts = value.split('.') + self.assertEqual(len(version_parts), 3) # Three parts + int(version_parts[0]) # Major should be an integer + int(version_parts[1]) # Minor should be an integer From 9600cd5127ca5ed10fbce449cb10740cd798a73b Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 13 Jan 2026 11:25:04 -0600 Subject: [PATCH 2/3] Update license specification --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 803525b..b9e4fad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,9 +11,8 @@ authors = [ description = 'URL parser and manipulator based on the WHAT WG URL standard' readme = "README.rst" requires-python = ">=3.10" -license = {text = "Apache 2.0"} +license = "Apache-2.0" classifiers = [ - "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", ] From 621df574df362bf240b6d01e9964fe1cd5639c6f Mon Sep 17 00:00:00 2001 From: Bo Bayles Date: Tue, 13 Jan 2026 11:29:12 -0600 Subject: [PATCH 3/3] Better dependency specification --- requirements/development.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/development.txt b/requirements/development.txt index 662427b..ab7fd35 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -1,7 +1,8 @@ build coverage ruff -setuptools +setuptools>=77.0.0 +packaging>=24.2 Sphinx twine urllib3