* [gentoo-commits] repo/gentoo:master commit in: dev-python/uvicorn/files/
@ 2021-10-29 22:01 Conrad Kostecki
0 siblings, 0 replies; 2+ messages in thread
From: Conrad Kostecki @ 2021-10-29 22:01 UTC (permalink / raw
To: gentoo-commits
commit: 527566f337f939d0efd25e5775aa72fae339fcea
Author: Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Mon Oct 18 17:25:15 2021 +0000
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Fri Oct 29 21:40:45 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=527566f3
dev-python/uvicorn: remove unused patch(es)
Closes: https://github.com/gentoo/gentoo/pull/22625
Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
.../files/uvicorn-0.13.4-fix-wsproto-1.0.patch | 31 ----------------------
1 file changed, 31 deletions(-)
diff --git a/dev-python/uvicorn/files/uvicorn-0.13.4-fix-wsproto-1.0.patch b/dev-python/uvicorn/files/uvicorn-0.13.4-fix-wsproto-1.0.patch
deleted file mode 100644
index da3038d6db4..00000000000
--- a/dev-python/uvicorn/files/uvicorn-0.13.4-fix-wsproto-1.0.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-https://github.com/encode/uvicorn/pull/892
-
-diff --git a/tests/protocols/test_http.py b/tests/protocols/test_http.py
-index f35a965d..25110fc6 100644
---- a/tests/protocols/test_http.py
-+++ b/tests/protocols/test_http.py
-@@ -67,6 +67,7 @@
- b"Host: example.org",
- b"Connection: upgrade",
- b"Upgrade: websocket",
-+ b"Sec-WebSocket-Version: 11",
- b"",
- b"",
- ]
-diff --git a/tests/protocols/test_websocket.py b/tests/protocols/test_websocket.py
-index 24bc285f..7c3fcc08 100644
---- a/tests/protocols/test_websocket.py
-+++ b/tests/protocols/test_websocket.py
-@@ -51,7 +51,11 @@ def app(scope):
- async with httpx.AsyncClient() as client:
- response = await client.get(
- "http://127.0.0.1:8000",
-- headers={"upgrade": "websocket", "connection": "upgrade"},
-+ headers={
-+ "upgrade": "websocket",
-+ "connection": "upgrade",
-+ "sec-webSocket-version": "11",
-+ },
- timeout=5,
- )
- if response.status_code == 426:
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/uvicorn/files/
@ 2023-04-12 3:48 Sam James
0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-04-12 3:48 UTC (permalink / raw
To: gentoo-commits
commit: 12923d672c0285744ae3cf1f47e955581be1c214
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 12 03:47:09 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Apr 12 03:47:09 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12923d67
dev-python/uvicorn: improve optional Rust test deps patch
Followup to 5de4c34f3962d77d3cb9a53a5d50c5ff75bdd2fa, thanks to mgorny
for the suggestion. This lets us make it much smaller.
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/uvicorn-0.21.1-optional-rust.patch | 152 ++++++---------------
1 file changed, 44 insertions(+), 108 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
index 405eb5325ad9..dddeda158252 100644
--- a/dev-python/uvicorn/files/uvicorn-0.21.1-optional-rust.patch
+++ b/dev-python/uvicorn/files/uvicorn-0.21.1-optional-rust.patch
@@ -1,6 +1,6 @@
--- a/tests/conftest.py
+++ b/tests/conftest.py
-@@ -11,9 +11,15 @@ from time import sleep
+@@ -11,9 +11,13 @@ from time import sleep
from uuid import uuid4
import pytest
@@ -8,137 +8,73 @@
-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
++ pass
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
+@@ -30,12 +34,12 @@ LOGGING_CONFIG["loggers"]["uvicorn"]["propagate"] = True
+
--
--@pytest.fixture
+ @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()
++def tls_certificate_authority() -> "trustme.CA":
+ return trustme.CA()
--@pytest.fixture
+ @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_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):
-- 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
++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
+ @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_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):
-- 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
++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
+ @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
++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
+ @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
++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
+ @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")
++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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-12 3:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-29 22:01 [gentoo-commits] repo/gentoo:master commit in: dev-python/uvicorn/files/ Conrad Kostecki
-- strict thread matches above, loose matches on Subject: below --
2023-04-12 3:48 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox