* [gentoo-commits] repo/gentoo:master commit in: dev-python/uvicorn/files/, dev-python/uvicorn/
@ 2023-04-12 3:28 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2023-04-12 3:28 UTC (permalink / raw
To: gentoo-commits
commit: b13b83861adfe8853690b0275abad901ba2242d1
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 12 03:21:59 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Apr 12 03:21:59 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b13b8386
dev-python/uvicorn: make rust test dependencies optional
Bug: https://bugs.gentoo.org/904191
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/uvicorn-0.21.1-optional-rust.patch | 144 +++++++++++++++++++++
dev-python/uvicorn/uvicorn-0.21.1.ebuild | 23 +++-
2 files changed, 164 insertions(+), 3 deletions(-)
diff --git a/dev-python/uvicorn/files/uvicorn-0.21.1-optional-rust.patch b/dev-python/uvicorn/files/uvicorn-0.21.1-optional-rust.patch
new file mode 100644
index 000000000000..405eb5325ad9
--- /dev/null
+++ b/dev-python/uvicorn/files/uvicorn-0.21.1-optional-rust.patch
@@ -0,0 +1,144 @@
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -11,9 +11,15 @@ from time import sleep
+ from uuid import uuid4
+
+ import pytest
+-import trustme
+-from cryptography.hazmat.backends import default_backend
+-from cryptography.hazmat.primitives import serialization
++
++gentoo_got_rust_deps = True
++
++try:
++ import trustme
++ from cryptography.hazmat.backends import default_backend
++ from cryptography.hazmat.primitives import serialization
++except ImportError:
++ gentoo_got_rust_deps = False
+
+ from uvicorn.config import LOGGING_CONFIG
+
+@@ -28,72 +34,72 @@ from uvicorn.config import LOGGING_CONFIG
+ # See also: https://github.com/pytest-dev/pytest/issues/3697
+ LOGGING_CONFIG["loggers"]["uvicorn"]["propagate"] = True
+
+-
+-@pytest.fixture
+-def tls_certificate_authority() -> trustme.CA:
+- return trustme.CA()
++if gentoo_got_rust_deps:
++ @pytest.fixture
++ def tls_certificate_authority() -> trustme.CA:
++ return trustme.CA()
+
+
+-@pytest.fixture
+-def tls_certificate(tls_certificate_authority: trustme.CA) -> trustme.LeafCert:
+- return tls_certificate_authority.issue_cert(
+- "localhost",
+- "127.0.0.1",
+- "::1",
+- )
++ @pytest.fixture
++ def tls_certificate(tls_certificate_authority: trustme.CA) -> trustme.LeafCert:
++ return tls_certificate_authority.issue_cert(
++ "localhost",
++ "127.0.0.1",
++ "::1",
++ )
+
+
+-@pytest.fixture
+-def tls_ca_certificate_pem_path(tls_certificate_authority: trustme.CA):
+- with tls_certificate_authority.cert_pem.tempfile() as ca_cert_pem:
+- yield ca_cert_pem
++ @pytest.fixture
++ def tls_ca_certificate_pem_path(tls_certificate_authority: trustme.CA):
++ with tls_certificate_authority.cert_pem.tempfile() as ca_cert_pem:
++ yield ca_cert_pem
+
+
+-@pytest.fixture
+-def tls_ca_certificate_private_key_path(tls_certificate_authority: trustme.CA):
+- with tls_certificate_authority.private_key_pem.tempfile() as private_key:
+- yield private_key
++ @pytest.fixture
++ def tls_ca_certificate_private_key_path(tls_certificate_authority: trustme.CA):
++ with tls_certificate_authority.private_key_pem.tempfile() as private_key:
++ yield private_key
+
+
+-@pytest.fixture
+-def tls_certificate_private_key_encrypted_path(tls_certificate):
+- private_key = serialization.load_pem_private_key(
+- tls_certificate.private_key_pem.bytes(),
+- password=None,
+- backend=default_backend(),
+- )
+- encrypted_key = private_key.private_bytes(
+- serialization.Encoding.PEM,
+- serialization.PrivateFormat.TraditionalOpenSSL,
+- serialization.BestAvailableEncryption(b"uvicorn password for the win"),
+- )
+- with trustme.Blob(encrypted_key).tempfile() as private_encrypted_key:
+- yield private_encrypted_key
++ @pytest.fixture
++ def tls_certificate_private_key_encrypted_path(tls_certificate):
++ private_key = serialization.load_pem_private_key(
++ tls_certificate.private_key_pem.bytes(),
++ password=None,
++ backend=default_backend(),
++ )
++ encrypted_key = private_key.private_bytes(
++ serialization.Encoding.PEM,
++ serialization.PrivateFormat.TraditionalOpenSSL,
++ serialization.BestAvailableEncryption(b"uvicorn password for the win"),
++ )
++ with trustme.Blob(encrypted_key).tempfile() as private_encrypted_key:
++ yield private_encrypted_key
+
+
+-@pytest.fixture
+-def tls_certificate_private_key_path(tls_certificate: trustme.CA):
+- with tls_certificate.private_key_pem.tempfile() as private_key:
+- yield private_key
++ @pytest.fixture
++ def tls_certificate_private_key_path(tls_certificate: trustme.CA):
++ with tls_certificate.private_key_pem.tempfile() as private_key:
++ yield private_key
+
+
+-@pytest.fixture
+-def tls_certificate_key_and_chain_path(tls_certificate: trustme.LeafCert):
+- with tls_certificate.private_key_and_cert_chain_pem.tempfile() as cert_pem:
+- yield cert_pem
++ @pytest.fixture
++ def tls_certificate_key_and_chain_path(tls_certificate: trustme.LeafCert):
++ with tls_certificate.private_key_and_cert_chain_pem.tempfile() as cert_pem:
++ yield cert_pem
+
+
+-@pytest.fixture
+-def tls_certificate_server_cert_path(tls_certificate: trustme.LeafCert):
+- with tls_certificate.cert_chain_pems[0].tempfile() as cert_pem:
+- yield cert_pem
++ @pytest.fixture
++ def tls_certificate_server_cert_path(tls_certificate: trustme.LeafCert):
++ with tls_certificate.cert_chain_pems[0].tempfile() as cert_pem:
++ yield cert_pem
+
+
+-@pytest.fixture
+-def tls_ca_ssl_context(tls_certificate_authority: trustme.CA) -> ssl.SSLContext:
+- ssl_ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
+- tls_certificate_authority.configure_trust(ssl_ctx)
+- return ssl_ctx
++ @pytest.fixture
++ def tls_ca_ssl_context(tls_certificate_authority: trustme.CA) -> ssl.SSLContext:
++ ssl_ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
++ tls_certificate_authority.configure_trust(ssl_ctx)
++ return ssl_ctx
+
+
+ @pytest.fixture(scope="package")
diff --git a/dev-python/uvicorn/uvicorn-0.21.1.ebuild b/dev-python/uvicorn/uvicorn-0.21.1.ebuild
index 4dbce7762222..18a059cd9646 100644
--- a/dev-python/uvicorn/uvicorn-0.21.1.ebuild
+++ b/dev-python/uvicorn/uvicorn-0.21.1.ebuild
@@ -23,6 +23,7 @@ SRC_URI="
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv"
+IUSE="test-rust"
RDEPEND="
>=dev-python/asgiref-3.4.0[${PYTHON_USEDEP}]
@@ -32,7 +33,6 @@ RDEPEND="
BDEPEND="
test? (
dev-python/a2wsgi[${PYTHON_USEDEP}]
- dev-python/cryptography[${PYTHON_USEDEP}]
dev-python/httpx[${PYTHON_USEDEP}]
dev-python/pytest-asyncio[${PYTHON_USEDEP}]
dev-python/pytest-mock[${PYTHON_USEDEP}]
@@ -41,9 +41,17 @@ BDEPEND="
dev-python/trustme[${PYTHON_USEDEP}]
>=dev-python/websockets-10.4[${PYTHON_USEDEP}]
dev-python/wsproto[${PYTHON_USEDEP}]
+ test-rust? (
+ dev-python/cryptography[${PYTHON_USEDEP}]
+ dev-python/watchfiles[${PYTHON_USEDEP}]
+ )
)
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.21.1-optional-rust.patch
+)
+
distutils_enable_tests pytest
python_test() {
@@ -64,10 +72,19 @@ python_test() {
fi
local EPYTEST_IGNORE=()
- # love from Rust world
- if ! has_version "dev-python/watchfiles[${PYTHON_USEDEP}]"; then
+
+ if ! use test-rust ; then
+ EPYTEST_DESELECT+=(
+ # dev-python/cryptography
+ tests/test_config.py::test_ssl_config
+ tests/test_config.py::test_ssl_config_combined
+ )
+
EPYTEST_IGNORE+=(
+ # dev-python/watchdog
tests/supervisors/test_reload.py
+ # dev-python/cryptography
+ tests/test_ssl.py
)
fi
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/uvicorn/files/, dev-python/uvicorn/
@ 2023-07-24 13:02 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2023-07-24 13:02 UTC (permalink / raw
To: gentoo-commits
commit: 1bf48a0e40e5b897c802207afc9881f27ddffd25
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 24 12:59:10 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jul 24 12:59:10 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bf48a0e
dev-python/uvicorn: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/uvicorn/Manifest | 2 -
.../files/uvicorn-0.21.1-optional-rust.patch | 80 ------------------
dev-python/uvicorn/uvicorn-0.20.0.ebuild | 72 ----------------
dev-python/uvicorn/uvicorn-0.21.1-r1.ebuild | 96 ----------------------
4 files changed, 250 deletions(-)
diff --git a/dev-python/uvicorn/Manifest b/dev-python/uvicorn/Manifest
index 69419035acb3..3171d6eec91b 100644
--- a/dev-python/uvicorn/Manifest
+++ b/dev-python/uvicorn/Manifest
@@ -1,4 +1,2 @@
-DIST uvicorn-0.20.0.gh.tar.gz 716073 BLAKE2B 7f1cf4808e985199d39e54e3563119cef1fe3af31361ad05a91278d32bc6f0dd741ad87f6073fbb720e9d9d4119fc8389b4e2feaaede665d8f68c56d56b37a17 SHA512 fa089da78dd7ce3cc02d83405e7db401e6055e947b80bf4abb0e3a4dce6575d97761f3bd6fcc253f3338caad5f797fc4f01bd40d833514d9cc0bcd0f072ad793
-DIST uvicorn-0.21.1.gh.tar.gz 717974 BLAKE2B ac4e1ec6a2533e364fe2ad7cd52558ad70b82e3c739756f33123d08737cc406ba879f50f7fa1cba875d0f0a284da5467e4ca15139558462401fb6a7938a17f61 SHA512 9f8dfe42df5d7f3923609e177def66d68fac24e3016fc1c6fead489320c2e5eaf7816a43e242f4426e670ce16f200db41679ac6ebd29a000ba76ca72b9ccec76
DIST uvicorn-0.22.0.gh.tar.gz 719615 BLAKE2B 8e0d6099e66822e77fb447c279de8f29c820e1f9e24e37629d36349ebd4b52ea8dc69f7fc02a21e9711925e3ad1ec4a95464ea315c7bc40a905810dc9a1ef077 SHA512 61af2df426a5bc060a32730ddf024ca8dd39ccea6800235bf48d7e0c694b9d363cbedd826f498063c6779061af84b6b56e8ab0a466e74291dbbaf5ae995e5587
DIST uvicorn-0.23.0.gh.tar.gz 722671 BLAKE2B f1fdc09e211c97d9e326b41b197d12ad019e660a1a2fcc0c70ee62c2016a20bbcafb9be759fc9b682185e70e10881c9a3511168eb0e75844973f7c3321d455bd SHA512 2449150abdf7914b47ff8c02732549cd71e63cc7c6440eedfd200340df4e70543232ed1ef47e2ebc6b29fc9a0d4615f542d7d1c603ce2673f121afab63d89b47
diff --git a/dev-python/uvicorn/files/uvicorn-0.21.1-optional-rust.patch b/dev-python/uvicorn/files/uvicorn-0.21.1-optional-rust.patch
deleted file mode 100644
index dddeda158252..000000000000
--- a/dev-python/uvicorn/files/uvicorn-0.21.1-optional-rust.patch
+++ /dev/null
@@ -1,80 +0,0 @@
---- a/tests/conftest.py
-+++ b/tests/conftest.py
-@@ -11,9 +11,13 @@ from time import sleep
- from uuid import uuid4
-
- import pytest
--import trustme
--from cryptography.hazmat.backends import default_backend
--from cryptography.hazmat.primitives import serialization
-+
-+try:
-+ import trustme
-+ from cryptography.hazmat.backends import default_backend
-+ from cryptography.hazmat.primitives import serialization
-+except ImportError:
-+ pass
-
- from uvicorn.config import LOGGING_CONFIG
-
-@@ -30,12 +34,12 @@ LOGGING_CONFIG["loggers"]["uvicorn"]["propagate"] = True
-
-
- @pytest.fixture
--def tls_certificate_authority() -> trustme.CA:
-+def tls_certificate_authority() -> "trustme.CA":
- return trustme.CA()
-
-
- @pytest.fixture
--def tls_certificate(tls_certificate_authority: trustme.CA) -> trustme.LeafCert:
-+def tls_certificate(tls_certificate_authority: "trustme.CA") -> "trustme.LeafCert":
- return tls_certificate_authority.issue_cert(
- "localhost",
- "127.0.0.1",
-@@ -44,13 +48,13 @@ def tls_certificate(tls_certificate_authority: trustme.CA) -> trustme.LeafCert:
-
-
- @pytest.fixture
--def tls_ca_certificate_pem_path(tls_certificate_authority: trustme.CA):
-+def tls_ca_certificate_pem_path(tls_certificate_authority: "trustme.CA"):
- with tls_certificate_authority.cert_pem.tempfile() as ca_cert_pem:
- yield ca_cert_pem
-
-
- @pytest.fixture
--def tls_ca_certificate_private_key_path(tls_certificate_authority: trustme.CA):
-+def tls_ca_certificate_private_key_path(tls_certificate_authority: "trustme.CA"):
- with tls_certificate_authority.private_key_pem.tempfile() as private_key:
- yield private_key
-
-@@ -72,25 +76,25 @@ def tls_certificate_private_key_encrypted_path(tls_certificate):
-
-
- @pytest.fixture
--def tls_certificate_private_key_path(tls_certificate: trustme.CA):
-+def tls_certificate_private_key_path(tls_certificate: "trustme.CA"):
- with tls_certificate.private_key_pem.tempfile() as private_key:
- yield private_key
-
-
- @pytest.fixture
--def tls_certificate_key_and_chain_path(tls_certificate: trustme.LeafCert):
-+def tls_certificate_key_and_chain_path(tls_certificate: "trustme.LeafCert"):
- with tls_certificate.private_key_and_cert_chain_pem.tempfile() as cert_pem:
- yield cert_pem
-
-
- @pytest.fixture
--def tls_certificate_server_cert_path(tls_certificate: trustme.LeafCert):
-+def tls_certificate_server_cert_path(tls_certificate: "trustme.LeafCert"):
- with tls_certificate.cert_chain_pems[0].tempfile() as cert_pem:
- yield cert_pem
-
-
- @pytest.fixture
--def tls_ca_ssl_context(tls_certificate_authority: trustme.CA) -> ssl.SSLContext:
-+def tls_ca_ssl_context(tls_certificate_authority: "trustme.CA") -> ssl.SSLContext:
- ssl_ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
- tls_certificate_authority.configure_trust(ssl_ctx)
- return ssl_ctx
diff --git a/dev-python/uvicorn/uvicorn-0.20.0.ebuild b/dev-python/uvicorn/uvicorn-0.20.0.ebuild
deleted file mode 100644
index bc899d6b9df0..000000000000
--- a/dev-python/uvicorn/uvicorn-0.20.0.ebuild
+++ /dev/null
@@ -1,72 +0,0 @@
-# Copyright 2021-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=hatchling
-PYTHON_COMPAT=( pypy3 python3_{9..11} )
-
-inherit distutils-r1 optfeature
-
-DESCRIPTION="Lightning-fast ASGI server implementation"
-HOMEPAGE="
- https://www.uvicorn.org/
- https://github.com/encode/uvicorn/
- https://pypi.org/project/uvicorn/
-"
-SRC_URI="https://github.com/encode/${PN}/archive/${PV}.tar.gz -> ${P}.gh.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-
-RDEPEND="
- >=dev-python/asgiref-3.4.0[${PYTHON_USEDEP}]
- >=dev-python/click-7.0[${PYTHON_USEDEP}]
- >=dev-python/h11-0.8[${PYTHON_USEDEP}]
-"
-BDEPEND="
- test? (
- dev-python/cryptography[${PYTHON_USEDEP}]
- dev-python/httpx[${PYTHON_USEDEP}]
- dev-python/pytest-asyncio[${PYTHON_USEDEP}]
- dev-python/pytest-mock[${PYTHON_USEDEP}]
- dev-python/python-dotenv[${PYTHON_USEDEP}]
- dev-python/pyyaml[${PYTHON_USEDEP}]
- dev-python/trustme[${PYTHON_USEDEP}]
- >=dev-python/websockets-10.4[${PYTHON_USEDEP}]
- dev-python/wsproto[${PYTHON_USEDEP}]
- )
-"
-
-distutils_enable_tests pytest
-
-python_test() {
- local EPYTEST_DESELECT=(
- # too long path for unix socket
- tests/test_config.py::test_bind_unix_socket_works_with_reload_or_workers
- # need unpackaged httptools
- "tests/middleware/test_logging.py::test_trace_logging_on_http_protocol[httptools]"
- tests/protocols/test_http.py::test_fragmentation
- )
- if [[ ${EPYTHON} == pypy3 ]]; then
- # TODO
- EPYTEST_DESELECT+=(
- tests/middleware/test_logging.py::test_running_log_using_fd
- )
- fi
-
- local EPYTEST_IGNORE=()
- # love from Rust world
- if ! has_version "dev-python/watchfiles[${PYTHON_USEDEP}]"; then
- EPYTEST_IGNORE+=(
- tests/supervisors/test_reload.py
- )
- fi
-
- epytest
-}
-
-pkg_postinst() {
- optfeature "auto reload on file changes" dev-python/watchfiles
-}
diff --git a/dev-python/uvicorn/uvicorn-0.21.1-r1.ebuild b/dev-python/uvicorn/uvicorn-0.21.1-r1.ebuild
deleted file mode 100644
index 792a7809216c..000000000000
--- a/dev-python/uvicorn/uvicorn-0.21.1-r1.ebuild
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 2021-2023 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=hatchling
-PYTHON_COMPAT=( pypy3 python3_{9..11} )
-
-inherit distutils-r1 optfeature
-
-DESCRIPTION="Lightning-fast ASGI server implementation"
-HOMEPAGE="
- https://www.uvicorn.org/
- https://github.com/encode/uvicorn/
- https://pypi.org/project/uvicorn/
-"
-# as of 0.21.0, no tests in sdist
-SRC_URI="
- https://github.com/encode/uvicorn/archive/${PV}.tar.gz
- -> ${P}.gh.tar.gz
-"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-IUSE="test-rust"
-
-RDEPEND="
- >=dev-python/asgiref-3.4.0[${PYTHON_USEDEP}]
- >=dev-python/click-7.0[${PYTHON_USEDEP}]
- >=dev-python/h11-0.8[${PYTHON_USEDEP}]
-"
-BDEPEND="
- test? (
- dev-python/a2wsgi[${PYTHON_USEDEP}]
- dev-python/httpx[${PYTHON_USEDEP}]
- dev-python/pytest-asyncio[${PYTHON_USEDEP}]
- dev-python/pytest-mock[${PYTHON_USEDEP}]
- dev-python/python-dotenv[${PYTHON_USEDEP}]
- dev-python/pyyaml[${PYTHON_USEDEP}]
- >=dev-python/websockets-10.4[${PYTHON_USEDEP}]
- dev-python/wsproto[${PYTHON_USEDEP}]
- test-rust? (
- dev-python/cryptography[${PYTHON_USEDEP}]
- dev-python/trustme[${PYTHON_USEDEP}]
- dev-python/watchfiles[${PYTHON_USEDEP}]
- )
- )
-"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-0.21.1-optional-rust.patch
-)
-
-distutils_enable_tests pytest
-
-python_test() {
- local EPYTEST_DESELECT=(
- # too long path for unix socket
- tests/test_config.py::test_bind_unix_socket_works_with_reload_or_workers
- # need unpackaged httptools
- "tests/middleware/test_logging.py::test_trace_logging_on_http_protocol[httptools]"
- tests/protocols/test_http.py::test_fragmentation
- # TODO
- tests/protocols/test_websocket.py::test_connection_lost_before_handshake_complete
- )
- if [[ ${EPYTHON} == pypy3 ]]; then
- # TODO
- EPYTEST_DESELECT+=(
- tests/middleware/test_logging.py::test_running_log_using_fd
- )
- fi
-
- local EPYTEST_IGNORE=()
-
- if ! use test-rust ; then
- EPYTEST_DESELECT+=(
- # dev-python/cryptography
- tests/test_config.py::test_ssl_config
- tests/test_config.py::test_ssl_config_combined
- )
-
- EPYTEST_IGNORE+=(
- # dev-python/watchfiles
- tests/supervisors/test_reload.py
- # dev-python/cryptography
- tests/test_ssl.py
- )
- fi
-
- epytest
-}
-
-pkg_postinst() {
- optfeature "auto reload on file changes" dev-python/watchfiles
-}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/uvicorn/files/, dev-python/uvicorn/
@ 2023-12-26 10:50 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2023-12-26 10:50 UTC (permalink / raw
To: gentoo-commits
commit: 300e20ddab67230cc4a6d06e457a9cc22658a66a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 26 10:41:16 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Dec 26 10:50:22 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=300e20dd
dev-python/uvicorn: Bump to 0.25.0
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/uvicorn/Manifest | 1 +
dev-python/uvicorn/files/uvicorn-0.25.0-test.patch | 46 +++++++++++++
dev-python/uvicorn/uvicorn-0.25.0.ebuild | 77 ++++++++++++++++++++++
3 files changed, 124 insertions(+)
diff --git a/dev-python/uvicorn/Manifest b/dev-python/uvicorn/Manifest
index 025f5112a687..80b466c9ff71 100644
--- a/dev-python/uvicorn/Manifest
+++ b/dev-python/uvicorn/Manifest
@@ -1 +1,2 @@
DIST uvicorn-0.24.0.gh.tar.gz 715220 BLAKE2B b71273545ae244544b5336524bf4ad1f386c8bb2b1addc501514833f37376f8a09a1d4dfc2272c3b62555337a20750af827c9a7a4c3bffc6327a9d1809869cfa SHA512 98b58ce17a1f072f36923b1b616f818cbadd091256ce1281a5236268ba2378d212384d9c3390b5903edfda5c692a67935051379e31732df45422595a88c69232
+DIST uvicorn-0.25.0.gh.tar.gz 717386 BLAKE2B f0a472676a732d7807137f157c95574584d882bf9ae8531c4e2c1164ebe9eec2172da62f72f07032ada422b7932f221457686aa22ab6fbceac57685ad91920b8 SHA512 19c1e6438c40ab1b1d30c9c9c84d65f2dc661197adcc6be3d7825223d933d4554ec388323e16452ef0409476766af1ae18bb3252a391099bd2e2bfe2b6c4abb2
diff --git a/dev-python/uvicorn/files/uvicorn-0.25.0-test.patch b/dev-python/uvicorn/files/uvicorn-0.25.0-test.patch
new file mode 100644
index 000000000000..8cd1cc7bb8c4
--- /dev/null
+++ b/dev-python/uvicorn/files/uvicorn-0.25.0-test.patch
@@ -0,0 +1,46 @@
+From 64013e8729afc93880a749974491ab5a90b29deb Mon Sep 17 00:00:00 2001
+From: Marcelo Trylesinski <marcelotryle@gmail.com>
+Date: Tue, 26 Dec 2023 10:28:55 +0100
+Subject: [PATCH] Allow test suite to run without httptools installed
+
+---
+ tests/protocols/test_http.py | 19 +++++++------------
+ 1 file changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/tests/protocols/test_http.py b/tests/protocols/test_http.py
+index fde4cc70b..ca06b33a6 100644
+--- a/tests/protocols/test_http.py
++++ b/tests/protocols/test_http.py
+@@ -994,25 +994,20 @@ async def test_huge_headers_h11_max_incomplete():
+
+
+ @pytest.mark.anyio
+-@pytest.mark.parametrize(
+- "protocol_cls,close_header",
+- (
+- pytest.param(
+- HttpToolsProtocol, b"connection: close", marks=skip_if_no_httptools
+- ),
+- (H11Protocol, b"Connection: close"),
+- ),
+-)
+-async def test_return_close_header(protocol_cls, close_header: bytes):
++async def test_return_close_header(
++ http_protocol_cls: "Type[HttpToolsProtocol | H11Protocol]"
++):
+ app = Response("Hello, world", media_type="text/plain")
+
+- protocol = get_connected_protocol(app, protocol_cls)
++ protocol = get_connected_protocol(app, http_protocol_cls)
+ protocol.data_received(CONNECTION_CLOSE_REQUEST)
+ await protocol.loop.run_one()
+ assert b"HTTP/1.1 200 OK" in protocol.transport.buffer
+ assert b"content-type: text/plain" in protocol.transport.buffer
+ assert b"content-length: 12" in protocol.transport.buffer
+- assert close_header in protocol.transport.buffer
++ # NOTE: We need to use `.lower()` because H11 implementation doesn't allow Uvicorn
++ # to lowercase them. See: https://github.com/python-hyper/h11/issues/156
++ assert b"connection: close" in protocol.transport.buffer.lower()
+
+
+ @pytest.mark.anyio
diff --git a/dev-python/uvicorn/uvicorn-0.25.0.ebuild b/dev-python/uvicorn/uvicorn-0.25.0.ebuild
new file mode 100644
index 000000000000..a675be713124
--- /dev/null
+++ b/dev-python/uvicorn/uvicorn-0.25.0.ebuild
@@ -0,0 +1,77 @@
+# Copyright 2021-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=hatchling
+PYTHON_COMPAT=( pypy3 python3_{10..12} )
+
+inherit distutils-r1 optfeature
+
+DESCRIPTION="Lightning-fast ASGI server implementation"
+HOMEPAGE="
+ https://www.uvicorn.org/
+ https://github.com/encode/uvicorn/
+ https://pypi.org/project/uvicorn/
+"
+# as of 0.21.0, no tests in sdist
+SRC_URI="
+ https://github.com/encode/uvicorn/archive/${PV}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="test-rust"
+
+RDEPEND="
+ >=dev-python/asgiref-3.4.0[${PYTHON_USEDEP}]
+ >=dev-python/click-7.0[${PYTHON_USEDEP}]
+ >=dev-python/h11-0.8[${PYTHON_USEDEP}]
+"
+BDEPEND="
+ test? (
+ dev-python/a2wsgi[${PYTHON_USEDEP}]
+ dev-python/httpx[${PYTHON_USEDEP}]
+ dev-python/pytest-asyncio[${PYTHON_USEDEP}]
+ dev-python/pytest-mock[${PYTHON_USEDEP}]
+ dev-python/python-dotenv[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ >=dev-python/websockets-10.4[${PYTHON_USEDEP}]
+ dev-python/wsproto[${PYTHON_USEDEP}]
+ test-rust? (
+ dev-python/cryptography[${PYTHON_USEDEP}]
+ dev-python/trustme[${PYTHON_USEDEP}]
+ dev-python/watchfiles[${PYTHON_USEDEP}]
+ )
+ )
+"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+ # https://github.com/encode/uvicorn/pull/2198
+ "${FILESDIR}/${P}-test.patch"
+)
+
+python_test() {
+ local EPYTEST_DESELECT=(
+ # too long path for unix socket
+ tests/test_config.py::test_bind_unix_socket_works_with_reload_or_workers
+ )
+ case ${EPYTHON} in
+ pypy3)
+ # TODO
+ EPYTEST_DESELECT+=(
+ tests/middleware/test_logging.py::test_running_log_using_fd
+ )
+ ;;
+ esac
+
+ epytest
+}
+
+pkg_postinst() {
+ optfeature "auto reload on file changes" dev-python/watchfiles
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/uvicorn/files/, dev-python/uvicorn/
@ 2024-10-26 13:13 Michał Górny
0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2024-10-26 13:13 UTC (permalink / raw
To: gentoo-commits
commit: dc6c3c9bb78fef65f82b17e1387ef66be1cda743
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 26 13:12:12 2024 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Oct 26 13:12:12 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dc6c3c9b
dev-python/uvicorn: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/uvicorn/Manifest | 2 -
.../uvicorn/files/uvicorn-0.31.0-ws-0.13.patch | 25 -------
dev-python/uvicorn/uvicorn-0.30.6.ebuild | 75 --------------------
dev-python/uvicorn/uvicorn-0.31.0.ebuild | 80 ----------------------
4 files changed, 182 deletions(-)
diff --git a/dev-python/uvicorn/Manifest b/dev-python/uvicorn/Manifest
index 52cfe3a42492..1e516d274930 100644
--- a/dev-python/uvicorn/Manifest
+++ b/dev-python/uvicorn/Manifest
@@ -1,4 +1,2 @@
-DIST uvicorn-0.30.6.gh.tar.gz 724296 BLAKE2B c95ee6764947e51958da2e62627d20bfbef48f065832f6214c7c05b9daf344b76eb6b0ec4ccbc3ebc2502b9f2cc77157dcf90e824cec0a8adc62601ceb4abf0c SHA512 d4c4410648509b14e18c3c86a33df4152e951703d287153a26ad35f4dce35eb594b940d3773cb444119b9bfa72ae3885c54d84b1a09c0c6069b80941f453c2e8
-DIST uvicorn-0.31.0.gh.tar.gz 728288 BLAKE2B 8cdc15895be8689cb38c402beac415463b185d2402484e16cac28d51e4ef7359a23e084163761abe62483a02d987555dda628938c5b93cdf19e5759372598557 SHA512 d1d8875681ecb81febac2eb1d00d245f421bfb3d06c91be831daf11411c94368707afde8781147752bcd327fa3eb83cff1635f24b9d57107675e69c12885950d
DIST uvicorn-0.31.1.gh.tar.gz 728604 BLAKE2B 4f8f4e34bc6b13f6f0866a6890855a5b3bf9aad179de2fdeab40fdb017f76acfaa1cb7c9bd97d55d2ea5cd513afc3b6857ae0613912f6be55dc1d17cf810b213 SHA512 2ceab852cd7819fee592cf2507fa9ce8cc80f19dec0492fec621e6eded4a47edecbe4fe559a8474dacff260546ba146e33af9cab964e121356797fdc9a2dae28
DIST uvicorn-0.32.0.gh.tar.gz 728882 BLAKE2B 8ab5341b23a97fbf4e8d6cf046f71ef09831bd7914c631fd1683eefe8a2aa8377b572443c180505f0413d5c04462519aa7fd848623d9765905add47650dad19e SHA512 66bfaf0ff37507b90fa63d4a9d3cdb8ae7aa70629ad9bcf52a391abd2c85e67cfce066ba8fb39d9e8f7781bdbad52a03ac9beb9cdbc91af59c29bcf2654ba8b0
diff --git a/dev-python/uvicorn/files/uvicorn-0.31.0-ws-0.13.patch b/dev-python/uvicorn/files/uvicorn-0.31.0-ws-0.13.patch
deleted file mode 100644
index c0e89b47b801..000000000000
--- a/dev-python/uvicorn/files/uvicorn-0.31.0-ws-0.13.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From c5966796a772d1e6504fd5c7f3e4678ede1a5a29 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sat, 28 Sep 2024 08:50:03 +0200
-Subject: [PATCH] Update test_websocket.py::test_invalid_upgrade for
- websockets==0.13*
-
-Update the expected messages in
-`tests/protocols/test_websocket.py::test_invalid_upgrade[websockets-h11]`
-to cover the new variant emitted by websockets==0.13*.
----
- tests/protocols/test_websocket.py | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/tests/protocols/test_websocket.py b/tests/protocols/test_websocket.py
-index 074c01d03..78c65d635 100644
---- a/tests/protocols/test_websocket.py
-+++ b/tests/protocols/test_websocket.py
-@@ -114,6 +114,7 @@ def app(scope: Scope):
- "missing or empty sec-websocket-key header", # wsproto
- "failed to open a websocket connection: missing " "sec-websocket-key header",
- "failed to open a websocket connection: missing or empty " "sec-websocket-key header",
-+ "failed to open a websocket connection: missing sec-websocket-key header; 'sec-websocket-key'",
- ]
- )
-
diff --git a/dev-python/uvicorn/uvicorn-0.30.6.ebuild b/dev-python/uvicorn/uvicorn-0.30.6.ebuild
deleted file mode 100644
index d7e76373c495..000000000000
--- a/dev-python/uvicorn/uvicorn-0.30.6.ebuild
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2021-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=hatchling
-PYTHON_COMPAT=( pypy3 python3_{10..13} )
-
-inherit distutils-r1 optfeature
-
-DESCRIPTION="Lightning-fast ASGI server implementation"
-HOMEPAGE="
- https://www.uvicorn.org/
- https://github.com/encode/uvicorn/
- https://pypi.org/project/uvicorn/
-"
-# as of 0.28.0, no tests in sdist
-SRC_URI="
- https://github.com/encode/uvicorn/archive/${PV}.tar.gz
- -> ${P}.gh.tar.gz
-"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86"
-IUSE="test-rust"
-
-RDEPEND="
- >=dev-python/asgiref-3.4.0[${PYTHON_USEDEP}]
- >=dev-python/click-7.0[${PYTHON_USEDEP}]
- >=dev-python/h11-0.8[${PYTHON_USEDEP}]
- $(python_gen_cond_dep '
- >=dev-python/typing-extensions-4.0[${PYTHON_USEDEP}]
- ' 3.10)
-"
-BDEPEND="
- test? (
- dev-python/a2wsgi[${PYTHON_USEDEP}]
- dev-python/httpx[${PYTHON_USEDEP}]
- dev-python/pytest-asyncio[${PYTHON_USEDEP}]
- dev-python/pytest-mock[${PYTHON_USEDEP}]
- dev-python/python-dotenv[${PYTHON_USEDEP}]
- dev-python/pyyaml[${PYTHON_USEDEP}]
- >=dev-python/websockets-10.4[${PYTHON_USEDEP}]
- dev-python/wsproto[${PYTHON_USEDEP}]
- test-rust? (
- dev-python/cryptography[${PYTHON_USEDEP}]
- dev-python/trustme[${PYTHON_USEDEP}]
- dev-python/watchfiles[${PYTHON_USEDEP}]
- )
- )
-"
-
-distutils_enable_tests pytest
-
-python_test() {
- local EPYTEST_DESELECT=(
- # too long path for unix socket
- tests/test_config.py::test_bind_unix_socket_works_with_reload_or_workers
- )
- case ${EPYTHON} in
- pypy3)
- # TODO
- EPYTEST_DESELECT+=(
- tests/middleware/test_logging.py::test_running_log_using_fd
- )
- ;;
- esac
-
- epytest
-}
-
-pkg_postinst() {
- optfeature "auto reload on file changes" dev-python/watchfiles
-}
diff --git a/dev-python/uvicorn/uvicorn-0.31.0.ebuild b/dev-python/uvicorn/uvicorn-0.31.0.ebuild
deleted file mode 100644
index 6aaf8d360663..000000000000
--- a/dev-python/uvicorn/uvicorn-0.31.0.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 2021-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-DISTUTILS_USE_PEP517=hatchling
-PYTHON_COMPAT=( pypy3 python3_{10..13} )
-
-inherit distutils-r1 optfeature
-
-DESCRIPTION="Lightning-fast ASGI server implementation"
-HOMEPAGE="
- https://www.uvicorn.org/
- https://github.com/encode/uvicorn/
- https://pypi.org/project/uvicorn/
-"
-# as of 0.28.0, no tests in sdist
-SRC_URI="
- https://github.com/encode/uvicorn/archive/${PV}.tar.gz
- -> ${P}.gh.tar.gz
-"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
-IUSE="test-rust"
-
-RDEPEND="
- >=dev-python/asgiref-3.4.0[${PYTHON_USEDEP}]
- >=dev-python/click-7.0[${PYTHON_USEDEP}]
- >=dev-python/h11-0.8[${PYTHON_USEDEP}]
- $(python_gen_cond_dep '
- >=dev-python/typing-extensions-4.0[${PYTHON_USEDEP}]
- ' 3.10)
-"
-BDEPEND="
- test? (
- dev-python/a2wsgi[${PYTHON_USEDEP}]
- dev-python/httpx[${PYTHON_USEDEP}]
- dev-python/pytest-asyncio[${PYTHON_USEDEP}]
- dev-python/pytest-mock[${PYTHON_USEDEP}]
- dev-python/python-dotenv[${PYTHON_USEDEP}]
- dev-python/pyyaml[${PYTHON_USEDEP}]
- >=dev-python/websockets-10.4[${PYTHON_USEDEP}]
- dev-python/wsproto[${PYTHON_USEDEP}]
- test-rust? (
- dev-python/cryptography[${PYTHON_USEDEP}]
- dev-python/trustme[${PYTHON_USEDEP}]
- dev-python/watchfiles[${PYTHON_USEDEP}]
- )
- )
-"
-
-distutils_enable_tests pytest
-
-PATCHES=(
- # https://github.com/encode/uvicorn/pull/2470
- "${FILESDIR}/${P}-ws-0.13.patch"
-)
-
-python_test() {
- local EPYTEST_DESELECT=(
- # too long path for unix socket
- tests/test_config.py::test_bind_unix_socket_works_with_reload_or_workers
- )
- case ${EPYTHON} in
- pypy3)
- # TODO
- EPYTEST_DESELECT+=(
- tests/middleware/test_logging.py::test_running_log_using_fd
- )
- ;;
- esac
-
- epytest
-}
-
-pkg_postinst() {
- optfeature "auto reload on file changes" dev-python/watchfiles
-}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-26 13:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-26 13:13 [gentoo-commits] repo/gentoo:master commit in: dev-python/uvicorn/files/, dev-python/uvicorn/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2023-12-26 10:50 Michał Górny
2023-07-24 13:02 Michał Górny
2023-04-12 3:28 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox