From 827d3686de178c9db096ba6fc2e2a8fa348c80c7 Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Sun, 4 Feb 2024 14:30:18 +0530 Subject: [PATCH 1/4] removed h2 dependency, instead maintained httcore as a default internal client --- poetry.lock | 99 ++++++++++++++++++++++++++++++++------------------ pyproject.toml | 12 +++++- 2 files changed, 74 insertions(+), 37 deletions(-) diff --git a/poetry.lock b/poetry.lock index dc9a7d48..0bea9d98 100644 --- a/poetry.lock +++ b/poetry.lock @@ -22,6 +22,28 @@ doc = ["Sphinx", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd- test = ["anyio[trio]", "coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "mock (>=4)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (<0.22)"] +[[package]] +name = "anyio" +version = "4.2.0" +description = "High level compatibility layer for multiple asynchronous event loop implementations" +optional = false +python-versions = ">=3.8" +files = [ + {file = "anyio-4.2.0-py3-none-any.whl", hash = "sha256:745843b39e829e108e518c489b31dc757de7d2131d53fac32bd8df268227bfee"}, + {file = "anyio-4.2.0.tar.gz", hash = "sha256:e1875bb4b4e2de1669f4bc7869b6d3f54231cdced71605e6e64c9be77e3be50f"}, +] + +[package.dependencies] +exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +idna = ">=2.8" +sniffio = ">=1.1" +typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} + +[package.extras] +doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] +trio = ["trio (>=0.23)"] + [[package]] name = "async-case" version = "10.1.0" @@ -34,13 +56,13 @@ files = [ [[package]] name = "certifi" -version = "2023.11.17" +version = "2024.2.2" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2023.11.17-py3-none-any.whl", hash = "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474"}, - {file = "certifi-2023.11.17.tar.gz", hash = "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1"}, + {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, + {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, ] [[package]] @@ -186,51 +208,46 @@ files = [ typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [[package]] -name = "h2" -version = "4.1.0" -description = "HTTP/2 State-Machine based protocol implementation" +name = "httpcore" +version = "0.17.3" +description = "A minimal low-level HTTP client." optional = false -python-versions = ">=3.6.1" +python-versions = ">=3.7" files = [ - {file = "h2-4.1.0-py3-none-any.whl", hash = "sha256:03a46bcf682256c95b5fd9e9a99c1323584c3eec6440d379b9903d709476bc6d"}, - {file = "h2-4.1.0.tar.gz", hash = "sha256:a83aca08fbe7aacb79fec788c9c0bac936343560ed9ec18b82a13a12c28d2abb"}, + {file = "httpcore-0.17.3-py3-none-any.whl", hash = "sha256:c2789b767ddddfa2a5782e3199b2b7f6894540b17b16ec26b2c4d8e103510b87"}, + {file = "httpcore-0.17.3.tar.gz", hash = "sha256:a6f30213335e34c1ade7be6ec7c47f19f50c56db36abef1a9dfa3815b1cb3888"}, ] [package.dependencies] -hpack = ">=4.0,<5" -hyperframe = ">=6.0,<7" +anyio = ">=3.0,<5.0" +certifi = "*" +h11 = ">=0.13,<0.15" +sniffio = "==1.*" -[[package]] -name = "hpack" -version = "4.0.0" -description = "Pure-Python HPACK header compression" -optional = false -python-versions = ">=3.6.1" -files = [ - {file = "hpack-4.0.0-py3-none-any.whl", hash = "sha256:84a076fad3dc9a9f8063ccb8041ef100867b1878b25ef0ee63847a5d53818a6c"}, - {file = "hpack-4.0.0.tar.gz", hash = "sha256:fc41de0c63e687ebffde81187a948221294896f6bdc0ae2312708df339430095"}, -] +[package.extras] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] [[package]] name = "httpcore" -version = "0.17.3" +version = "1.0.2" description = "A minimal low-level HTTP client." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "httpcore-0.17.3-py3-none-any.whl", hash = "sha256:c2789b767ddddfa2a5782e3199b2b7f6894540b17b16ec26b2c4d8e103510b87"}, - {file = "httpcore-0.17.3.tar.gz", hash = "sha256:a6f30213335e34c1ade7be6ec7c47f19f50c56db36abef1a9dfa3815b1cb3888"}, + {file = "httpcore-1.0.2-py3-none-any.whl", hash = "sha256:096cc05bca73b8e459a1fc3dcf585148f63e534eae4339559c9b8a8d6399acc7"}, + {file = "httpcore-1.0.2.tar.gz", hash = "sha256:9fc092e4799b26174648e54b74ed5f683132a464e95643b226e00c2ed2fa6535"}, ] [package.dependencies] -anyio = ">=3.0,<5.0" certifi = "*" h11 = ">=0.13,<0.15" -sniffio = "==1.*" [package.extras] +asyncio = ["anyio (>=4.0,<5.0)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] +trio = ["trio (>=0.22.0,<0.23.0)"] [[package]] name = "httpx" @@ -245,7 +262,6 @@ files = [ [package.dependencies] certifi = "*" -h2 = {version = ">=3,<5", optional = true, markers = "extra == \"http2\""} httpcore = ">=0.15.0,<0.18.0" idna = "*" sniffio = "*" @@ -257,16 +273,29 @@ http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] [[package]] -name = "hyperframe" -version = "6.0.1" -description = "HTTP/2 framing layer for Python" +name = "httpx" +version = "0.25.2" +description = "The next generation HTTP client." optional = false -python-versions = ">=3.6.1" +python-versions = ">=3.8" files = [ - {file = "hyperframe-6.0.1-py3-none-any.whl", hash = "sha256:0ec6bafd80d8ad2195c4f03aacba3a8265e57bc4cff261e802bf39970ed02a15"}, - {file = "hyperframe-6.0.1.tar.gz", hash = "sha256:ae510046231dc8e9ecb1a6586f63d2347bf4c8905914aa84ba585ae85f28a914"}, + {file = "httpx-0.25.2-py3-none-any.whl", hash = "sha256:a05d3d052d9b2dfce0e3896636467f8a5342fb2b902c819428e1ac65413ca118"}, + {file = "httpx-0.25.2.tar.gz", hash = "sha256:8b8fcaa0c8ea7b05edd69a094e63a2094c4efcb48129fb757361bc423c0ad9e8"}, ] +[package.dependencies] +anyio = "*" +certifi = "*" +httpcore = "==1.*" +idna = "*" +sniffio = "*" + +[package.extras] +brotli = ["brotli", "brotlicffi"] +cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] +http2 = ["h2 (>=3,<5)"] +socks = ["socksio (==1.*)"] + [[package]] name = "idna" version = "3.6" @@ -845,4 +874,4 @@ oldcrypto = ["pycrypto"] [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "d59b84bbc5df77793003f49b4fe3d3efffae77c83174777cea2ad9f82b0ab8d1" +content-hash = "b982d490ba17297b4c73b24bcf75256f1cfc709f56336a9cf5ca2653c72c0572" diff --git a/pyproject.toml b/pyproject.toml index c2a79d0b..3e1cb3a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,8 +32,11 @@ python = "^3.7" # Mandatory dependencies methoddispatch = "^3.0.2" msgpack = "^1.0.0" -httpx = { version = "^0.24.1", extras = ["http2"] } - +httpx = [ + { version = "^0.24.1", python = "~3.7" }, + { version = "^0.25.0", python = "^3.8" }, +] +#h2 = "^4.1.0" # Optional dependencies pycrypto = { version = "^2.6.1", optional = true } pycryptodome = { version = "*", optional = true } @@ -42,10 +45,15 @@ pyee = [ { version = "^9.0.4", python = "~3.7" }, { version = "^11.1.0", python = "^3.8" } ] +#h2 = [ +# { version = "^3.1.0", python = "~3.7" }, +# { version = "^4.1.0", python = "^3.8" } +#] [tool.poetry.extras] oldcrypto = ["pycrypto"] crypto = ["pycryptodome"] +#http2 = ["h2"] [tool.poetry.dev-dependencies] pytest = "^7.1" From a38fb03645d22d918fec97e94e7b5b50280fbf81 Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Sun, 4 Feb 2024 14:36:20 +0530 Subject: [PATCH 2/4] Added h2 package as an explicit dependency to httpx for HTTP2 communication --- poetry.lock | 39 ++++++++++++++++++++++++++++++++++++++- pyproject.toml | 8 ++------ 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/poetry.lock b/poetry.lock index 0bea9d98..0e71f83f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -207,6 +207,32 @@ files = [ [package.dependencies] typing-extensions = {version = "*", markers = "python_version < \"3.8\""} +[[package]] +name = "h2" +version = "4.1.0" +description = "HTTP/2 State-Machine based protocol implementation" +optional = false +python-versions = ">=3.6.1" +files = [ + {file = "h2-4.1.0-py3-none-any.whl", hash = "sha256:03a46bcf682256c95b5fd9e9a99c1323584c3eec6440d379b9903d709476bc6d"}, + {file = "h2-4.1.0.tar.gz", hash = "sha256:a83aca08fbe7aacb79fec788c9c0bac936343560ed9ec18b82a13a12c28d2abb"}, +] + +[package.dependencies] +hpack = ">=4.0,<5" +hyperframe = ">=6.0,<7" + +[[package]] +name = "hpack" +version = "4.0.0" +description = "Pure-Python HPACK header compression" +optional = false +python-versions = ">=3.6.1" +files = [ + {file = "hpack-4.0.0-py3-none-any.whl", hash = "sha256:84a076fad3dc9a9f8063ccb8041ef100867b1878b25ef0ee63847a5d53818a6c"}, + {file = "hpack-4.0.0.tar.gz", hash = "sha256:fc41de0c63e687ebffde81187a948221294896f6bdc0ae2312708df339430095"}, +] + [[package]] name = "httpcore" version = "0.17.3" @@ -296,6 +322,17 @@ cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] +[[package]] +name = "hyperframe" +version = "6.0.1" +description = "HTTP/2 framing layer for Python" +optional = false +python-versions = ">=3.6.1" +files = [ + {file = "hyperframe-6.0.1-py3-none-any.whl", hash = "sha256:0ec6bafd80d8ad2195c4f03aacba3a8265e57bc4cff261e802bf39970ed02a15"}, + {file = "hyperframe-6.0.1.tar.gz", hash = "sha256:ae510046231dc8e9ecb1a6586f63d2347bf4c8905914aa84ba585ae85f28a914"}, +] + [[package]] name = "idna" version = "3.6" @@ -874,4 +911,4 @@ oldcrypto = ["pycrypto"] [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "b982d490ba17297b4c73b24bcf75256f1cfc709f56336a9cf5ca2653c72c0572" +content-hash = "822cadc0134225a385d942104ec1377a7d680d87a354501a18e0ac7426fb03dd" diff --git a/pyproject.toml b/pyproject.toml index 3e1cb3a1..694264af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,8 @@ httpx = [ { version = "^0.24.1", python = "~3.7" }, { version = "^0.25.0", python = "^3.8" }, ] -#h2 = "^4.1.0" +h2 = "^4.1.0" # required for httx package, HTTP2 communication + # Optional dependencies pycrypto = { version = "^2.6.1", optional = true } pycryptodome = { version = "*", optional = true } @@ -45,15 +46,10 @@ pyee = [ { version = "^9.0.4", python = "~3.7" }, { version = "^11.1.0", python = "^3.8" } ] -#h2 = [ -# { version = "^3.1.0", python = "~3.7" }, -# { version = "^4.1.0", python = "^3.8" } -#] [tool.poetry.extras] oldcrypto = ["pycrypto"] crypto = ["pycryptodome"] -#http2 = ["h2"] [tool.poetry.dev-dependencies] pytest = "^7.1" From a5287a08430c2b259119239e845fda5bc8a9934c Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Mon, 5 Feb 2024 16:47:00 +0530 Subject: [PATCH 3/4] Added http2 extras to httpx explicitly --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 694264af..15406a51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,10 +33,10 @@ python = "^3.7" methoddispatch = "^3.0.2" msgpack = "^1.0.0" httpx = [ - { version = "^0.24.1", python = "~3.7" }, - { version = "^0.25.0", python = "^3.8" }, + { version = "^0.24.1", python = "~3.7", extras= ["http2"] }, + { version = "^0.25.0", python = "^3.8", extras= ["http2"] }, ] -h2 = "^4.1.0" # required for httx package, HTTP2 communication +#h2 = "^4.1.0" # required for httx package, HTTP2 communication # Optional dependencies pycrypto = { version = "^2.6.1", optional = true } From 9daf8836a1c3698eb0b5dcee9bb550669f4e3c99 Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Mon, 5 Feb 2024 17:06:17 +0530 Subject: [PATCH 4/4] Revert "Added http2 extras to httpx explicitly" This reverts commit a5287a08430c2b259119239e845fda5bc8a9934c. --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 15406a51..694264af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,10 +33,10 @@ python = "^3.7" methoddispatch = "^3.0.2" msgpack = "^1.0.0" httpx = [ - { version = "^0.24.1", python = "~3.7", extras= ["http2"] }, - { version = "^0.25.0", python = "^3.8", extras= ["http2"] }, + { version = "^0.24.1", python = "~3.7" }, + { version = "^0.25.0", python = "^3.8" }, ] -#h2 = "^4.1.0" # required for httx package, HTTP2 communication +h2 = "^4.1.0" # required for httx package, HTTP2 communication # Optional dependencies pycrypto = { version = "^2.6.1", optional = true }