[arch-commits] Commit in python-httpx/repos (3 files)

Evangelos Foutras foutrelis at gemini.archlinux.org
Wed Dec 1 13:52:41 UTC 2021


    Date: Wednesday, December 1, 2021 @ 13:52:41
  Author: foutrelis
Revision: 1059281

archrelease: copy trunk to community-staging-any

Added:
  python-httpx/repos/community-staging-any/
  python-httpx/repos/community-staging-any/0001-Do-not-override-the-system-SSL-certificates-with-the.patch
    (from rev 1059280, python-httpx/trunk/0001-Do-not-override-the-system-SSL-certificates-with-the.patch)
  python-httpx/repos/community-staging-any/PKGBUILD
    (from rev 1059280, python-httpx/trunk/PKGBUILD)

-----------------------------------------------------------------+
 0001-Do-not-override-the-system-SSL-certificates-with-the.patch |   87 ++++++++++
 PKGBUILD                                                        |   49 +++++
 2 files changed, 136 insertions(+)

Copied: python-httpx/repos/community-staging-any/0001-Do-not-override-the-system-SSL-certificates-with-the.patch (from rev 1059280, python-httpx/trunk/0001-Do-not-override-the-system-SSL-certificates-with-the.patch)
===================================================================
--- community-staging-any/0001-Do-not-override-the-system-SSL-certificates-with-the.patch	                        (rev 0)
+++ community-staging-any/0001-Do-not-override-the-system-SSL-certificates-with-the.patch	2021-12-01 13:52:41 UTC (rev 1059281)
@@ -0,0 +1,87 @@
+From f2d28b9a35572134b336bcc6e347659cf0504be6 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz at archlinux.org>
+Date: Mon, 13 Jul 2020 11:29:54 -0400
+Subject: [PATCH] Do not override the system SSL certificates with the certifi
+ bundle.
+
+We need to respect the system certification policy, and by default the
+ssl module will use our packaged ca-certificates.
+
+ssl.create_default_context(cafile=None) is the default to use the
+builtin (system) certs, but due to the sorcery which this module uses to
+check how arguments are being passed, it's less invasive to simply
+hardcode the standard certificate path instead of letting python
+properly handle it.
+---
+ httpx/_config.py     | 4 +---
+ setup.py             | 1 -
+ tests/test_config.py | 5 ++---
+ 3 files changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/httpx/_config.py b/httpx/_config.py
+index 9d29f9f..1ac64e1 100644
+--- a/httpx/_config.py
++++ b/httpx/_config.py
+@@ -4,8 +4,6 @@ import typing
+ from base64 import b64encode
+ from pathlib import Path
+ 
+-import certifi
+-
+ from ._compat import set_minimum_tls_version_1_2
+ from ._models import URL, Headers
+ from ._types import CertTypes, HeaderTypes, TimeoutTypes, URLTypes, VerifyTypes
+@@ -57,7 +55,7 @@ class SSLConfig:
+     SSL Configuration.
+     """
+ 
+-    DEFAULT_CA_BUNDLE_PATH = Path(certifi.where())
++    DEFAULT_CA_BUNDLE_PATH = Path("/etc/ssl/certs/ca-certificates.crt")
+ 
+     def __init__(
+         self,
+diff --git a/setup.py b/setup.py
+index f3ada86..396d713 100644
+--- a/setup.py
++++ b/setup.py
+@@ -56,7 +56,6 @@ setup(
+     include_package_data=True,
+     zip_safe=False,
+     install_requires=[
+-        "certifi",
+         "charset_normalizer",
+         "sniffio",
+         "rfc3986[idna2008]>=1.3,<2",
+diff --git a/tests/test_config.py b/tests/test_config.py
+index f218f8f..74ab743 100644
+--- a/tests/test_config.py
++++ b/tests/test_config.py
+@@ -3,7 +3,6 @@ import ssl
+ import sys
+ from pathlib import Path
+ 
+-import certifi
+ import pytest
+ 
+ import httpx
+@@ -21,7 +20,7 @@ def test_load_ssl_config_verify_non_existing_path():
+ 
+ 
+ def test_load_ssl_config_verify_existing_file():
+-    context = httpx.create_ssl_context(verify=certifi.where())
++    context = httpx.create_ssl_context(verify="/etc/ssl/certs/ca-certificates.crt")
+     assert context.verify_mode == ssl.VerifyMode.CERT_REQUIRED
+     assert context.check_hostname is True
+ 
+@@ -44,7 +43,7 @@ def test_load_ssl_config_verify_env_file(
+ 
+ 
+ def test_load_ssl_config_verify_directory():
+-    path = Path(certifi.where()).parent
++    path = Path("/etc/ssl/certs/ca-certificates.crt").parent
+     context = httpx.create_ssl_context(verify=str(path))
+     assert context.verify_mode == ssl.VerifyMode.CERT_REQUIRED
+     assert context.check_hostname is True
+-- 
+2.32.0
+

Copied: python-httpx/repos/community-staging-any/PKGBUILD (from rev 1059280, python-httpx/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD	                        (rev 0)
+++ community-staging-any/PKGBUILD	2021-12-01 13:52:41 UTC (rev 1059281)
@@ -0,0 +1,49 @@
+# Maintainer: Eli Schwartz <eschwartz at archlinux.org>
+
+_pkgname=httpx
+pkgname=python-httpx
+pkgver=0.21.1
+pkgrel=2
+pkgdesc="A next generation HTTP client for Python"
+arch=('any')
+url="https://github.com/encode/${_pkgname}"
+license=('BSD')
+depends=('python-charset-normalizer' 'python-httpcore' 'python-idna' 'python-rfc3986' 'python-sniffio' 'python-rich')
+optdepends=('python-brotlicffi: for brotli response decompression')
+makedepends=('python-setuptools')
+checkdepends=('python-pytest-asyncio' 'python-pytest-trio' 'python-typing_extensions' 'python-brotlicffi' 'python-h2' 'python-trustme' 'uvicorn')
+source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz"
+        "0001-Do-not-override-the-system-SSL-certificates-with-the.patch")
+sha512sums=('a4f737f6c6ae909fd3ea811e0ff3b78ed6496da8d797ef49746f744216e055f8225d613fe935d5e2780aa1b233053ad436e8849eef578e662ca8ee34513ad12e'
+            'faf90f908ab8d5054d096eef1ba4e9cee733eb8178d2df0dfe922923bf8a98eebf880b9a6be3386caffed88229f82f1199c026ede455a57998246821a37e5748')
+b2sums=('c3c800657abaed461ab6f44e3cd9799be4b6499070a5db2ee8d5d61c776d86591c74192eb1c88d4072dc361ea4c9448a3ed061c715fa4504fc931fdd96ccde62'
+        '3e020b5f3c3aeeede6304851023eed4ab10f74df68203b504b5564892aa960d5c52521279a0b9cf40ead1e18b5ce9ee3998ad4502e6008f07808817d0405b7c7')
+
+prepare() {
+    cd ${_pkgname}-${pkgver}
+
+    # bad certifi
+    patch -p1 -i ../0001-Do-not-override-the-system-SSL-certificates-with-the.patch
+
+    # fix tests
+    sed -e 's|Transfer-Encoding|transfer-encoding|g' -i tests/test_main.py
+}
+
+build() {
+    cd ${_pkgname}-${pkgver}
+
+    python setup.py build
+}
+
+check() {
+    cd ${_pkgname}-${pkgver}
+
+    pytest -W ignore::DeprecationWarning
+}
+
+package() {
+    cd ${_pkgname}-${pkgver}
+
+    python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
+    install -Dm644 LICENSE.md "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE.md
+}



More information about the arch-commits mailing list