From d25159566a4a0c70c8cb6bc7f7dcc35f29cc51bb Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 4 Aug 2025 16:47:09 +0100 Subject: [PATCH 1/4] Add package version --- pyproject.toml | 5 ++++- scripts/unasync | 1 + src/ahttpx/__init__.py | 3 +++ src/ahttpx/__version__.py | 2 ++ src/httpx/__init__.py | 3 +++ src/httpx/__version__.py | 2 ++ 6 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/ahttpx/__version__.py create mode 100644 src/httpx/__version__.py diff --git a/pyproject.toml b/pyproject.toml index 6d752c3..291091a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,6 @@ build-backend = "hatchling.build" [project] name = "httpx" -version = "1.0.dev1" description = "HTTP, for Python." requires-python = ">=3.10" authors = [ @@ -26,3 +25,7 @@ dependencies = [ "h11==0.*", "truststore==0.10", ] +dynamic = ["version"] + +[tool.hatch.version] +path = "src/httpx/__version__.py" diff --git a/scripts/unasync b/scripts/unasync index 0210b4e..160445e 100755 --- a/scripts/unasync +++ b/scripts/unasync @@ -4,6 +4,7 @@ import unasync unasync.unasync_files( fpath_list = [ "src/ahttpx/__init__.py", + "src/ahttpx/__version__.py", "src/ahttpx/_client.py", "src/ahttpx/_content.py", "src/ahttpx/_headers.py", diff --git a/src/ahttpx/__init__.py b/src/ahttpx/__init__.py index f5bfe85..3bc3985 100644 --- a/src/ahttpx/__init__.py +++ b/src/ahttpx/__init__.py @@ -1,3 +1,4 @@ +from .__version__ import __title__, __version__ from ._client import * # Client from ._content import * # Content, File, Files, Form, HTML, JSON, MultiPart, Text from ._headers import * # Headers @@ -13,6 +14,8 @@ __all__ = [ + "__title__", + "__version__", "ByteStream", "Client", "Connection", diff --git a/src/ahttpx/__version__.py b/src/ahttpx/__version__.py new file mode 100644 index 0000000..7b86099 --- /dev/null +++ b/src/ahttpx/__version__.py @@ -0,0 +1,2 @@ +title = "ahttpx" +version = "1.0.dev2" diff --git a/src/httpx/__init__.py b/src/httpx/__init__.py index f5bfe85..3bc3985 100644 --- a/src/httpx/__init__.py +++ b/src/httpx/__init__.py @@ -1,3 +1,4 @@ +from .__version__ import __title__, __version__ from ._client import * # Client from ._content import * # Content, File, Files, Form, HTML, JSON, MultiPart, Text from ._headers import * # Headers @@ -13,6 +14,8 @@ __all__ = [ + "__title__", + "__version__", "ByteStream", "Client", "Connection", diff --git a/src/httpx/__version__.py b/src/httpx/__version__.py new file mode 100644 index 0000000..7b86099 --- /dev/null +++ b/src/httpx/__version__.py @@ -0,0 +1,2 @@ +title = "ahttpx" +version = "1.0.dev2" From b0eea56badfdb089ba11abe714fe70662e2399ac Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 4 Aug 2025 16:55:03 +0100 Subject: [PATCH 2/4] Fixup unasync --- scripts/unasync | 6 +++++- src/httpx/__version__.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/unasync b/scripts/unasync index 160445e..f5edb79 100755 --- a/scripts/unasync +++ b/scripts/unasync @@ -19,6 +19,10 @@ unasync.unasync_files( "src/ahttpx/_urls.py" ], rules = [ - unasync.Rule("src/ahttpx/", "src/httpx/"), + unasync.Rule( + "src/ahttpx/", + "src/httpx/", + additional_replacements={"ahttpx": "httpx"} + ), ] ) diff --git a/src/httpx/__version__.py b/src/httpx/__version__.py index 7b86099..e9b6648 100644 --- a/src/httpx/__version__.py +++ b/src/httpx/__version__.py @@ -1,2 +1,2 @@ -title = "ahttpx" +title = "httpx" version = "1.0.dev2" From 086695bbb614264ae102099085c26cd8a3577a08 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 4 Aug 2025 16:57:00 +0100 Subject: [PATCH 3/4] Fixup __version__/__title__ --- src/ahttpx/__version__.py | 4 ++-- src/httpx/__version__.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ahttpx/__version__.py b/src/ahttpx/__version__.py index 7b86099..4bff011 100644 --- a/src/ahttpx/__version__.py +++ b/src/ahttpx/__version__.py @@ -1,2 +1,2 @@ -title = "ahttpx" -version = "1.0.dev2" +__title__ = "ahttpx" +__version__ = "1.0.dev2" \ No newline at end of file diff --git a/src/httpx/__version__.py b/src/httpx/__version__.py index e9b6648..ded414d 100644 --- a/src/httpx/__version__.py +++ b/src/httpx/__version__.py @@ -1,2 +1,2 @@ -title = "httpx" -version = "1.0.dev2" +__title__ = "httpx" +__version__ = "1.0.dev2" \ No newline at end of file From 3ccbaaeecc66a74eaa41967f9ada95f6d43d41d3 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 4 Aug 2025 17:06:37 +0100 Subject: [PATCH 4/4] Fixup __title__/__version__ --- src/ahttpx/__init__.py | 3 ++- src/httpx/__init__.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ahttpx/__init__.py b/src/ahttpx/__init__.py index 3bc3985..5d688ae 100644 --- a/src/ahttpx/__init__.py +++ b/src/ahttpx/__init__.py @@ -56,4 +56,5 @@ __locals = locals() for __name in __all__: - setattr(__locals[__name], "__module__", "httpx") + if not __name.startswith('__'): + setattr(__locals[__name], "__module__", "httpx") diff --git a/src/httpx/__init__.py b/src/httpx/__init__.py index 3bc3985..5d688ae 100644 --- a/src/httpx/__init__.py +++ b/src/httpx/__init__.py @@ -56,4 +56,5 @@ __locals = locals() for __name in __all__: - setattr(__locals[__name], "__module__", "httpx") + if not __name.startswith('__'): + setattr(__locals[__name], "__module__", "httpx")