Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions ada_url/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
HostType,
SchemeType,
URLSearchParams,
get_version,
check_url,
idna,
idna_to_ascii,
Expand All @@ -21,6 +22,7 @@
'URL',
'URLSearchParams',
'check_url',
'get_version',
'idna',
'idna_to_ascii',
'idna_to_unicode',
Expand Down
3 changes: 3 additions & 0 deletions ada_url/ada_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
3 changes: 2 additions & 1 deletion requirements/development.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
build
coverage
ruff
setuptools
setuptools>=77.0.0
packaging>=24.2
Sphinx
twine
urllib3
Expand Down
10 changes: 10 additions & 0 deletions tests/test_ada_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
URLSearchParams as SearchParams,
URL,
check_url,
get_version,
idna,
idna_to_ascii,
idna_to_unicode,
Expand Down Expand Up @@ -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
Loading