From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 66A071581FB for ; Sun, 24 Nov 2024 03:28:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9282BE0856; Sun, 24 Nov 2024 03:28:46 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AEDF3E086F for ; Sun, 24 Nov 2024 03:28:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 32066341707 for ; Sun, 24 Nov 2024 03:28:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BAB101F0B for ; Sun, 24 Nov 2024 03:28:42 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1732418917.db4397f1b0ebf23dcd088bd82b3e3db2289e0d0a.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pypiserver/, dev-python/pypiserver/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/pypiserver/Manifest dev-python/pypiserver/files/pypiserver-2.3.1-unbundle-bottle.patch dev-python/pypiserver/pypiserver-2.3.1.ebuild X-VCS-Directories: dev-python/pypiserver/files/ dev-python/pypiserver/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: db4397f1b0ebf23dcd088bd82b3e3db2289e0d0a X-VCS-Branch: master Date: Sun, 24 Nov 2024 03:28:42 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d2048959-c1b7-4785-b3be-4fe1e3a970a7 X-Archives-Hash: 30776d4d3f9fca41130e87893921bfbd commit: db4397f1b0ebf23dcd088bd82b3e3db2289e0d0a Author: Michał Górny gentoo org> AuthorDate: Sun Nov 24 03:14:36 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Sun Nov 24 03:28:37 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db4397f1 dev-python/pypiserver: Bump to 2.3.1 Signed-off-by: Michał Górny gentoo.org> dev-python/pypiserver/Manifest | 1 + .../files/pypiserver-2.3.1-unbundle-bottle.patch | 110 +++++++++++++++++++++ dev-python/pypiserver/pypiserver-2.3.1.ebuild | 80 +++++++++++++++ 3 files changed, 191 insertions(+) diff --git a/dev-python/pypiserver/Manifest b/dev-python/pypiserver/Manifest index 803caea348ea..0befac19bc2d 100644 --- a/dev-python/pypiserver/Manifest +++ b/dev-python/pypiserver/Manifest @@ -1 +1,2 @@ DIST pypiserver-2.2.0.gh.tar.gz 158107 BLAKE2B 8c5e68201a4d376bc04ca8a5dc243c8c176f6a1bfd362fd5b0eb2875ca071cd124d15814312c2c14ded57c8476f72d41ccf1057eced2247d17f1cc6b7b12e86c SHA512 e1c313b52c852b90ee3efe07b754d91ac842483718fe30f0c59951aad9aa84bc36c9264956fd931a98aaad5ee151089a06472f19e4ae5e9eb1d20c72cc98f436 +DIST pypiserver-2.3.1.gh.tar.gz 165683 BLAKE2B 0a24b26a804f44bcd314595c4559fe7f41264910cd841e6ca7835e225fca2ec76073952ad9fb228c8e7f5d59045ad37578e676283499ab745fe204a7e353ee31 SHA512 c8a449e49daf2e3f149fbc87e01e40ad5cd5e33d1453b5d2bc97eefe10d7b8dcf74eda1008e62175de5f4f1429dec163774e19c92573ded1fe98f82293643e67 diff --git a/dev-python/pypiserver/files/pypiserver-2.3.1-unbundle-bottle.patch b/dev-python/pypiserver/files/pypiserver-2.3.1-unbundle-bottle.patch new file mode 100644 index 000000000000..c879e5291a88 --- /dev/null +++ b/dev-python/pypiserver/files/pypiserver-2.3.1-unbundle-bottle.patch @@ -0,0 +1,110 @@ +From 65c42e562500590d4e2377479ce23c4bcf4c325c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sun, 24 Nov 2024 04:11:10 +0100 +Subject: [PATCH] unbundle pypiserver + +--- + pypiserver/__init__.py | 2 +- + pypiserver/__main__.py | 2 +- + pypiserver/_app.py | 2 +- + tests/test_app.py | 3 ++- + tests/test_main.py | 8 ++++---- + 5 files changed, 9 insertions(+), 8 deletions(-) + +diff --git a/pypiserver/__init__.py b/pypiserver/__init__.py +index 326a13f..42bbcd0 100644 +--- a/pypiserver/__init__.py ++++ b/pypiserver/__init__.py +@@ -4,7 +4,7 @@ import re as _re + import sys + import typing as t + +-from pypiserver.bottle import Bottle ++from bottle import Bottle + from pypiserver.config import Config, RunConfig, strtobool + + version = __version__ = "2.3.1" +diff --git a/pypiserver/__main__.py b/pypiserver/__main__.py +index a47418b..b433335 100644 +--- a/pypiserver/__main__.py ++++ b/pypiserver/__main__.py +@@ -160,7 +160,7 @@ def main(argv: t.Sequence[str] = None) -> None: + + gevent.monkey.patch_all() + +- from pypiserver import bottle ++ import bottle + + bottle.debug(config.verbosity > 1) + bottle._stderr = ft.partial( # pylint: disable=protected-access +diff --git a/pypiserver/_app.py b/pypiserver/_app.py +index ed6ae20..2224619 100644 +--- a/pypiserver/_app.py ++++ b/pypiserver/_app.py +@@ -13,7 +13,7 @@ from urllib.parse import urljoin, urlparse, quote + + from pypiserver.config import RunConfig + from . import __version__ +-from .bottle import ( ++from bottle import ( + static_file, + redirect, + request, +diff --git a/tests/test_app.py b/tests/test_app.py +index 230a03e..8bd3d75 100644 +--- a/tests/test_app.py ++++ b/tests/test_app.py +@@ -8,12 +8,13 @@ import xmlrpc.client as xmlrpclib + from html import unescape + + # Third party imports ++import bottle + import pytest + import webtest + + # Local Imports + from tests.test_pkg_helpers import files, invalid_files +-from pypiserver import __main__, bottle, core, Bottle, _app ++from pypiserver import __main__, core, Bottle, _app + from pypiserver.backend import CachingFileBackend, SimpleFileBackend + + # Enable logging to detect any problems with it +diff --git a/tests/test_main.py b/tests/test_main.py +index 5fcace7..5369c78 100644 +--- a/tests/test_main.py ++++ b/tests/test_main.py +@@ -5,11 +5,11 @@ import sys + import typing as t + from unittest import mock + ++import bottle + import pytest + +-import pypiserver.bottle ++from bottle import Bottle + from pypiserver import __main__ +-from pypiserver.bottle import Bottle + + + THIS_DIR = pathlib.Path(__file__).parent +@@ -51,7 +51,7 @@ def main(monkeypatch): + main.update_args = args + main.update_kwargs = kwargs + +- monkeypatch.setattr("pypiserver.bottle.run", run) ++ monkeypatch.setattr("bottle.run", run) + monkeypatch.setattr("pypiserver.manage.update_all_packages", update) + + return main +@@ -262,7 +262,7 @@ def test_auto_servers() -> None: + """Test auto servers.""" + # A list of bottle ServerAdapters + bottle_adapters = tuple( +- a.__name__.lower() for a in pypiserver.bottle.AutoServer.adapters ++ a.__name__.lower() for a in bottle.AutoServer.adapters + ) + # We are going to expect that our AutoServer enum names must match those + # at least closely enough to be recognizable. +-- +2.47.0 + diff --git a/dev-python/pypiserver/pypiserver-2.3.1.ebuild b/dev-python/pypiserver/pypiserver-2.3.1.ebuild new file mode 100644 index 000000000000..e17ff4ee134b --- /dev/null +++ b/dev-python/pypiserver/pypiserver-2.3.1.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..13} pypy3 ) + +inherit distutils-r1 + +DESCRIPTION="Minimal PyPI server" +HOMEPAGE=" + https://github.com/pypiserver/pypiserver/ + https://pypi.org/project/pypiserver/ +" +SRC_URI=" + https://github.com/pypiserver/pypiserver/archive/v${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" + +RDEPEND=" + dev-python/bottle[${PYTHON_USEDEP}] + >=dev-python/packaging-23.2[${PYTHON_USEDEP}] + >=dev-python/pip-7[${PYTHON_USEDEP}] + $(python_gen_cond_dep ' + dev-python/importlib-resources[${PYTHON_USEDEP}] + ' 3.{10..11}) +" +# NB: many test deps are optional/specific to tests we skip +BDEPEND=" + dev-python/setuptools-git[${PYTHON_USEDEP}] + test? ( + >=dev-python/build-1.2.0[${PYTHON_USEDEP}] + >=dev-python/passlib-1.6[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + dev-python/webtest[${PYTHON_USEDEP}] + ) +" + +DOCS=( CHANGES.rst README.md ) + +PATCHES=( + "${FILESDIR}/${PN}-2.3.1-unbundle-bottle.patch" +) + +distutils_enable_tests pytest + +src_prepare() { + distutils-r1_src_prepare + + # stray unconditional importlib-resources dep + sed -i -e '/importlib_resources/d' setup.py || die + # remove bundled bottle (sic!) + rm pypiserver/bottle.py || die +} + +python_test() { + local EPYTEST_DESELECT=( + # Internet + tests/test_server.py::test_hash_algos + tests/test_server.py::test_pip_install_open_succeeds + tests/test_server.py::test_pip_install_authed_succeeds + # seems to rely on internal bottle details + tests/test_main.py::test_auto_servers + ) + + if ! has_version "dev-python/twine[${PYTHON_USEDEP}]"; then + EPYTEST_DESELECT+=( + tests/test_server.py::test_twine_upload + tests/test_server.py::test_twine_register + ) + fi + + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest tests +}