diff options
author | Repository mirror & CI <repomirrorci@gentoo.org> | 2021-11-27 10:36:23 +0000 |
---|---|---|
committer | Repository mirror & CI <repomirrorci@gentoo.org> | 2021-11-27 10:36:23 +0000 |
commit | 2d65200c2a24f6502d87fa367ba50cbe37b02534 (patch) | |
tree | 4c23a0ff78480df7effbf33bc2f798702eb2f426 | |
parent | 2021-11-27 09:51:39 UTC (diff) | |
parent | net-print/hplip-plugin: Actually bump to 3.21.10 (diff) | |
download | gentoo-2d65200c2a24f6502d87fa367ba50cbe37b02534.tar.gz gentoo-2d65200c2a24f6502d87fa367ba50cbe37b02534.tar.bz2 gentoo-2d65200c2a24f6502d87fa367ba50cbe37b02534.zip |
Merge updates from master
10 files changed, 212 insertions, 119 deletions
diff --git a/dev-python/cheroot/cheroot-8.5.2.ebuild b/dev-python/cheroot/cheroot-8.5.2.ebuild index d13d98546051..4d7c7d071b76 100644 --- a/dev-python/cheroot/cheroot-8.5.2.ebuild +++ b/dev-python/cheroot/cheroot-8.5.2.ebuild @@ -27,9 +27,9 @@ BDEPEND=" dev-python/jaraco-context[${PYTHON_USEDEP}] dev-python/jaraco-text[${PYTHON_USEDEP}] dev-python/portend[${PYTHON_USEDEP}] + dev-python/pyopenssl[${PYTHON_USEDEP}] dev-python/pytest-forked[${PYTHON_USEDEP}] >=dev-python/pytest-mock-1.11.0[${PYTHON_USEDEP}] - dev-python/pyopenssl[${PYTHON_USEDEP}] dev-python/requests-toolbelt[${PYTHON_USEDEP}] dev-python/requests-unixsocket[${PYTHON_USEDEP}] dev-python/trustme[${PYTHON_USEDEP}] @@ -55,6 +55,15 @@ python_prepare_all() { } python_test() { + local EPYTEST_IGNORE=() + if ! has_version "dev-python/pyopenssl[${PYTHON_USEDEP}]" || + ! has_version "dev-python/trustme[${PYTHON_USEDEP}]" + then + EPYTEST_IGNORE+=( + lib/cheroot/test/test_ssl.py + ) + fi + cd "${BUILD_DIR}" || die epytest } diff --git a/dev-python/pip/files/pip-21.3.1-cryptography-tests.patch b/dev-python/pip/files/pip-21.3.1-cryptography-tests.patch new file mode 100644 index 000000000000..1505d487ad40 --- /dev/null +++ b/dev-python/pip/files/pip-21.3.1-cryptography-tests.patch @@ -0,0 +1,39 @@ +From 8fa5d719a3c902ca9b6c9198229b7a67fecf8b8e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Fri, 26 Nov 2021 16:12:16 +0100 +Subject: [PATCH] Move cryptography-based imports into the fixture + +Move the imports that require cryptography into the cert_factory +fixture. This makes it possible to deselect these tests on systems +where cryptography cannot be installed. +--- + tests/conftest.py | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index 076aeaf19..bab6ab3f5 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -27,7 +27,6 @@ from pip._internal.cli.main import main as pip_entry_point + from pip._internal.locations import _USE_SYSCONFIG + from pip._internal.utils.temp_dir import global_tempdir_manager + from tests.lib import DATA_DIR, SRC_DIR, PipTestEnvironment, TestData +-from tests.lib.certs import make_tls_cert, serialize_cert, serialize_key + from tests.lib.path import Path + from tests.lib.server import MockServer as _MockServer + from tests.lib.server import make_mock_server, server_running +@@ -535,6 +534,11 @@ def deprecated_python() -> bool: + + @pytest.fixture(scope="session") + def cert_factory(tmpdir_factory: pytest.TempdirFactory) -> Callable[[], str]: ++ # Delay the import requiring cryptography in order to make it possible ++ # to deselect relevant tests on systems where cryptography cannot ++ # be installed. ++ from tests.lib.certs import make_tls_cert, serialize_cert, serialize_key ++ + def factory() -> str: + """Returns path to cert/key file.""" + output_path = Path(str(tmpdir_factory.mktemp("certs"))) / "cert.pem" +-- +2.34.1 + diff --git a/dev-python/pip/pip-21.3.1-r1.ebuild b/dev-python/pip/pip-21.3.1-r1.ebuild index 2b3d17d2f6de..37cf7af8a3d9 100644 --- a/dev-python/pip/pip-21.3.1-r1.ebuild +++ b/dev-python/pip/pip-21.3.1-r1.ebuild @@ -57,6 +57,7 @@ BDEPEND=" python_prepare_all() { local PATCHES=( "${FILESDIR}/${PN}-21.3-no-coverage.patch" + "${FILESDIR}/${P}-cryptography-tests.patch" ) if ! use vanilla; then PATCHES+=( "${FILESDIR}/pip-20.0.2-disable-system-install.patch" ) @@ -97,6 +98,15 @@ python_test() { tests/functional/test_warning.py::test_pip_works_with_warnings_as_errors ) + if ! has_version "dev-python/cryptography[${PYTHON_USEDEP}]"; then + EPYTEST_DESELECT+=( + tests/functional/test_install.py::test_install_sends_client_cert + tests/functional/test_install_config.py::test_do_not_prompt_for_authentication + tests/functional/test_install_config.py::test_prompt_for_authentication + tests/functional/test_install_config.py::test_prompt_for_keyring_if_needed + ) + fi + distutils_install_for_testing pushd "${WORKDIR}/virtualenv-${VENV_PV}" >/dev/null || die distutils_install_for_testing diff --git a/dev-python/pypiserver/pypiserver-1.4.2.ebuild b/dev-python/pypiserver/pypiserver-1.4.2.ebuild index d33d2bc3bcf9..18a622a294c3 100644 --- a/dev-python/pypiserver/pypiserver-1.4.2.ebuild +++ b/dev-python/pypiserver/pypiserver-1.4.2.ebuild @@ -32,16 +32,23 @@ DOCS=( README.rst ) distutils_enable_tests pytest -src_prepare() { - sed -i -e "/tox/d" setup.py || die - - # https://github.com/pypiserver/pypiserver/issues/312 - sed -e 's:test_root_count:_&:' \ - -i tests/test_app.py || die - sed -e 's:test_hash_algos:_&:' \ - -e 's:test_pipInstall_openOk:_&:' \ - -e 's:test_pipInstall_authedOk:_&:' \ - -i tests/test_server.py || die - - distutils-r1_src_prepare +python_test() { + local EPYTEST_DESELECT=( + # Internet + tests/test_server.py::test_hash_algos + tests/test_server.py::test_pipInstall_openOk + tests/test_server.py::test_pipInstall_authedOk + ) + + if ! has_version "dev-python/twine[${PYTHON_USEDEP}]"; then + EPYTEST_DESELECT+=( + tests/test_server.py::test_twine_register_authed_ok + tests/test_server.py::test_twine_register_open + tests/test_server.py::test_twine_upload_authed + tests/test_server.py::test_twine_upload_open + tests/test_server.py::test_twine_upload_partial_authed + ) + fi + + epytest } diff --git a/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-internet.patch b/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-internet.patch deleted file mode 100644 index b3dc2603c117..000000000000 --- a/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-internet.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/tests/test_multipart_encoder.py b/tests/test_multipart_encoder.py -index 575f54c..73a880e 100644 ---- a/tests/test_multipart_encoder.py -+++ b/tests/test_multipart_encoder.py -@@ -94,6 +94,7 @@ class TestFileFromURLWrapper(unittest.TestCase): - s = requests.Session() - self.recorder = get_betamax(s) - -+ @unittest.skip("test requires internet access") - def test_read_file(self): - url = ('https://stxnext.com/static/img/logo.830ebe551641.svg') - with self.recorder.use_cassette( -@@ -110,6 +111,7 @@ class TestFileFromURLWrapper(unittest.TestCase): - assert chunk == b'ww.w3.org/' - assert self.instance.len == 5147 - -+ @unittest.skip("test requires internet access") - def test_no_content_length_header(self): - url = ( - 'https://api.github.com/repos/sigmavirus24/github3.py/releases/' -@@ -191,6 +193,7 @@ class TestMultipartEncoder(unittest.TestCase): - m = MultipartEncoder([('field', 'foo'), ('file', fd)]) - assert m.read() is not None - -+ @unittest.skip("test requires internet access") - def test_reads_file_from_url_wrapper(self): - s = requests.Session() - recorder = get_betamax(s) diff --git a/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-py2.patch b/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-py2.patch deleted file mode 100644 index 6825c5f4ed4c..000000000000 --- a/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-tests-py2.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/tests/threaded/test_pool.py b/tests/threaded/test_pool.py -index 3e54b3c..9583c7b 100644 ---- a/tests/threaded/test_pool.py -+++ b/tests/threaded/test_pool.py -@@ -5,6 +5,7 @@ except ImportError: - import Queue as queue - import unittest - -+import sys - import mock - import pytest - -@@ -60,6 +61,7 @@ class TestPool(unittest.TestCase): - assert session.called is True - session.assert_called_once_with() - -+ @pytest.mark.skipif(sys.hexversion < 0x3000000, reason="broken on python2") - def test_from_exceptions_populates_a_queue(self): - """Ensure a Queue is properly populated from exceptions.""" - urls = ["https://httpbin.org/get?n={}".format(n) for n in range(5)] -@@ -77,6 +79,7 @@ class TestPool(unittest.TestCase): - for url in urls - ] - -+ @pytest.mark.skipif(sys.hexversion < 0x3000000, reason="broken on python2") - def test_from_urls_constructs_get_requests(self): - """Ensure a Queue is properly populated from an iterable of urls.""" - urls = ["https://httpbin.org/get?n={}".format(n) for n in range(5)] -@@ -92,6 +95,7 @@ class TestPool(unittest.TestCase): - for url in urls - ] - -+ @pytest.mark.skipif(sys.hexversion < 0x3000000, reason="broken on python2") - def test_from_urls_constructs_get_requests_with_kwargs(self): - """Ensure a Queue is properly populated from an iterable of urls.""" - def merge(*args): -@@ -130,6 +134,7 @@ class TestPool(unittest.TestCase): - for st in session_threads: - st.join.assert_called_once_with() - -+ @pytest.mark.skipif(sys.hexversion < 0x3000000, reason="broken on python2") - def test_get_response_returns_thread_response(self): - """Ensure that a ThreadResponse is made when there's data.""" - queues = [] -@@ -149,6 +154,7 @@ class TestPool(unittest.TestCase): - assert isinstance(p.get_response(), pool.ThreadResponse) - assert len([q for q in queues if q.get_nowait.called]) == 1 - -+ @pytest.mark.skipif(sys.hexversion < 0x3000000, reason="broken on python2") - def test_get_exception_returns_thread_exception(self): - """Ensure that a ThreadException is made when there's data.""" - queues = [] -@@ -168,6 +174,7 @@ class TestPool(unittest.TestCase): - assert isinstance(p.get_exception(), pool.ThreadException) - assert len([q for q in queues if q.get_nowait.called]) == 1 - -+ @pytest.mark.skipif(sys.hexversion < 0x3000000, reason="broken on python2") - def test_get_response_returns_none_when_queue_is_empty(self): - """Ensure that None is returned when the response Queue is empty.""" - queues = [] -@@ -187,6 +194,7 @@ class TestPool(unittest.TestCase): - assert p.get_response() is None - assert len([q for q in queues if q.get_nowait.called]) == 1 - -+ @pytest.mark.skipif(sys.hexversion < 0x3000000, reason="broken on python2") - def test_get_exception_returns_none_when_queue_is_empty(self): - """Ensure that None is returned when the exception Queue is empty.""" - queues = [] diff --git a/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild b/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild index c3c2c1f2eca4..c6bf76f2db87 100644 --- a/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild +++ b/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild @@ -19,6 +19,7 @@ RDEPEND="<dev-python/requests-3.0.0[${PYTHON_USEDEP}]" DEPEND="${RDEPEND} test? ( dev-python/betamax[${PYTHON_USEDEP}] + dev-python/cryptography[${PYTHON_USEDEP}] dev-python/mock[${PYTHON_USEDEP}] dev-python/pyopenssl[${PYTHON_USEDEP}] )" @@ -29,15 +30,27 @@ PATCHES=( "${FILESDIR}/requests-toolbelt-0.8.0-test-tracebacks.patch" "${FILESDIR}/requests-toolbelt-0.9.1-tests.patch" - # disable python2.7 test failures with newer requests versions - # bug: https://bugs.gentoo.org/635824 - # https://github.com/requests/toolbelt/issues/213 - "${FILESDIR}/requests-toolbelt-0.9.1-tests-py2.patch" - - # disable tests that require internet access - "${FILESDIR}/requests-toolbelt-0.9.1-tests-internet.patch" - "${FILESDIR}/requests-toolbelt-0.9.1-py310.patch" ) distutils_enable_tests pytest + +python_test() { + local EPYTEST_DESELECT=( + # Internet + tests/test_multipart_encoder.py::TestFileFromURLWrapper::test_no_content_length_header + tests/test_multipart_encoder.py::TestFileFromURLWrapper::test_read_file + tests/test_multipart_encoder.py::TestMultipartEncoder::test_reads_file_from_url_wrapper + ) + + local EPYTEST_IGNORE=() + if ! has_version "dev-python/cryptography[${PYTHON_USEDEP}]" || + ! has_version "dev-python/pyopenssl[${PYTHON_USEDEP}]" + then + EPYTEST_IGNORE+=( + tests/test_x509_adapter.py + ) + fi + + epytest +} diff --git a/dev-python/requests/files/requests-2.26.0-trustme-dep.patch b/dev-python/requests/files/requests-2.26.0-trustme-dep.patch new file mode 100644 index 000000000000..b3a81659a9be --- /dev/null +++ b/dev-python/requests/files/requests-2.26.0-trustme-dep.patch @@ -0,0 +1,37 @@ +From 6a1b5cbc124e0c3362ddefae5939db5c216a74db Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sat, 27 Nov 2021 10:33:35 +0100 +Subject: [PATCH] Skip the test requiring trustme when it is not available + +Modify the nosan_server fixture to cause test_https_warnings to be +skipped when trustme is not installed on the system, rather than causing +the whole test suite to fail unconditionally. This makes it possible +to run all the remaining tests on systems where trustme cannot be +installed due to its dependencies. +--- + tests/conftest.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/conftest.py b/tests/conftest.py +index 099462cf..5d38f254 100644 +--- a/tests/conftest.py ++++ b/tests/conftest.py +@@ -13,7 +13,6 @@ import threading + + import pytest + from requests.compat import urljoin +-import trustme + + + def prepare_url(value): +@@ -38,6 +37,7 @@ def httpbin_secure(httpbin_secure): + + @pytest.fixture + def nosan_server(tmp_path_factory): ++ trustme = pytest.importorskip('trustme') + tmpdir = tmp_path_factory.mktemp("certs") + ca = trustme.CA() + # only commonName, no subjectAltName +-- +2.34.1 + diff --git a/dev-python/requests/requests-2.26.0.ebuild b/dev-python/requests/requests-2.26.0.ebuild index 911ddfa1be0d..d30d1f190284 100644 --- a/dev-python/requests/requests-2.26.0.ebuild +++ b/dev-python/requests/requests-2.26.0.ebuild @@ -39,10 +39,11 @@ distutils_enable_tests pytest PATCHES=( "${FILESDIR}"/${P}-test.patch + "${FILESDIR}"/${P}-trustme-dep.patch ) python_test() { - local deselect=( + local EPYTEST_DESELECT=( # Internet requests/__init__.py::requests requests/api.py::requests.api.request @@ -55,5 +56,5 @@ python_test() { tests/test_requests.py::TestRequests::test_pyopenssl_redirect ) - epytest ${deselect[@]/#/--deselect } + epytest } diff --git a/net-print/hplip-plugin/hplip-plugin-3.21.10.ebuild b/net-print/hplip-plugin/hplip-plugin-3.21.10.ebuild new file mode 100644 index 000000000000..66a474795496 --- /dev/null +++ b/net-print/hplip-plugin/hplip-plugin-3.21.10.ebuild @@ -0,0 +1,73 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit unpacker + +DESCRIPTION="Proprietary plugins and firmware for HPLIP" +HOMEPAGE="https://developers.hp.com/hp-linux-imaging-and-printing/plugins" +SRC_URI="https://developers.hp.com/sites/default/files/hplip-${PV}-plugin.run" +LICENSE="hplip-plugin" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="orblite" + +RDEPEND=" + ~net-print/hplip-${PV} + virtual/udev + orblite? ( + media-gfx/sane-backends + >=sys-libs/glibc-2.26 + virtual/libusb:0 + ) +" +DEPEND="" + +S=${WORKDIR} + +HPLIP_HOME=/usr/share/hplip + +# Binary prebuilt package +QA_PREBUILT="${HPLIP_HOME}/*.so" + +# License does not allow us to redistribute the "source" package +RESTRICT="mirror" + +src_install() { + local hplip_arch + case "${ARCH}" in + amd64) hplip_arch="x86_64" ;; + arm) hplip_arch="arm32" ;; + arm64) hplip_arch="arm64" ;; + x86) hplip_arch="x86_32" ;; + *) die "Unsupported architecture." ;; + esac + + insinto "${HPLIP_HOME}"/data/firmware + doins *.fw.gz + + for plugin in *-${hplip_arch}.so; do + local plugin_type=prnt + case "${plugin}" in + bb_orblite-*) + use orblite || continue + plugin_type=scan ;; + bb_*) + plugin_type=scan ;; + fax_*) + plugin_type=fax ;; + esac + + exeinto "${HPLIP_HOME}"/${plugin_type}/plugins + newexe ${plugin} ${plugin/-${hplip_arch}} + done + + insinto /var/lib/hp + newins - hplip.state <<-_EOF_ + [plugin] + installed = 1 + eula = 1 + version = ${PV} + _EOF_ +} |