public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pypiserver/, dev-python/pypiserver/files/
Date: Tue, 24 May 2022 06:16:30 +0000 (UTC)	[thread overview]
Message-ID: <1653372940.4a6866d7bbbed4216bad68bf33a1e0100c5ee9e5.mgorny@gentoo> (raw)

commit:     4a6866d7bbbed4216bad68bf33a1e0100c5ee9e5
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 24 05:35:37 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 24 06:15:40 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a6866d7

dev-python/pypiserver: Unbundle dev-python/bottle

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/pypiserver-1.5.0-unbundle-bottle.patch   | 89 ++++++++++++++++++++++
 dev-python/pypiserver/pypiserver-1.5.0-r1.ebuild   | 68 +++++++++++++++++
 2 files changed, 157 insertions(+)

diff --git a/dev-python/pypiserver/files/pypiserver-1.5.0-unbundle-bottle.patch b/dev-python/pypiserver/files/pypiserver-1.5.0-unbundle-bottle.patch
new file mode 100644
index 000000000000..69e1764e3f2a
--- /dev/null
+++ b/dev-python/pypiserver/files/pypiserver-1.5.0-unbundle-bottle.patch
@@ -0,0 +1,89 @@
+diff -dupr pypiserver-1.5.0.orig/pypiserver/_app.py pypiserver-1.5.0/pypiserver/_app.py
+--- pypiserver-1.5.0.orig/pypiserver/_app.py	2022-05-24 07:32:24.710366623 +0200
++++ pypiserver-1.5.0/pypiserver/_app.py	2022-05-24 07:37:16.147456086 +0200
+@@ -13,7 +13,7 @@ from json import dumps
+ from pypiserver.config import RunConfig
+ from . import __version__
+ from . import core
+-from .bottle import (
++from bottle import (
+     static_file,
+     redirect,
+     request,
+diff -dupr pypiserver-1.5.0.orig/pypiserver/__init__.py pypiserver-1.5.0/pypiserver/__init__.py
+--- pypiserver-1.5.0.orig/pypiserver/__init__.py	2022-05-24 07:32:24.710366623 +0200
++++ pypiserver-1.5.0/pypiserver/__init__.py	2022-05-24 07:36:54.633769799 +0200
+@@ -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__ = "1.5.0"
+diff -dupr pypiserver-1.5.0.orig/pypiserver/__main__.py pypiserver-1.5.0/pypiserver/__main__.py
+--- pypiserver-1.5.0.orig/pypiserver/__main__.py	2022-05-24 07:32:24.710366623 +0200
++++ pypiserver-1.5.0/pypiserver/__main__.py	2022-05-24 07:34:05.608054452 +0200
+@@ -159,7 +159,7 @@ def main(argv: t.Sequence[str] = 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 -dupr pypiserver-1.5.0.orig/tests/test_app.py pypiserver-1.5.0/tests/test_app.py
+--- pypiserver-1.5.0.orig/tests/test_app.py	2022-05-24 07:32:24.710366623 +0200
++++ pypiserver-1.5.0/tests/test_app.py	2022-05-24 07:33:23.470919728 +0200
+@@ -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
++from pypiserver import __main__, core, Bottle
+ from pypiserver.backend import CachingFileBackend, SimpleFileBackend
+ 
+ # Enable logging to detect any problems with it
+diff -dupr pypiserver-1.5.0.orig/tests/test_main.py pypiserver-1.5.0/tests/test_main.py
+--- pypiserver-1.5.0.orig/tests/test_main.py	2022-05-24 07:32:24.710366623 +0200
++++ pypiserver-1.5.0/tests/test_main.py	2022-05-24 07:33:33.441025326 +0200
+@@ -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
+@@ -52,7 +52,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
+@@ -263,7 +263,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.

diff --git a/dev-python/pypiserver/pypiserver-1.5.0-r1.ebuild b/dev-python/pypiserver/pypiserver-1.5.0-r1.ebuild
new file mode 100644
index 000000000000..e688c055a7fe
--- /dev/null
+++ b/dev-python/pypiserver/pypiserver-1.5.0-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..10} 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 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos"
+
+RDEPEND="
+	dev-python/pip[${PYTHON_USEDEP}]
+	>=dev-python/wheel-0.25.0[${PYTHON_USEDEP}]
+"
+# NB: many test deps are optional/specific to tests we skip
+BDEPEND="
+	dev-python/setuptools-git[${PYTHON_USEDEP}]
+	test? (
+		dev-python/bottle[${PYTHON_USEDEP}]
+		>=dev-python/passlib-1.6[${PYTHON_USEDEP}]
+		dev-python/setuptools[${PYTHON_USEDEP}]
+		dev-python/twine[${PYTHON_USEDEP}]
+		dev-python/webtest[${PYTHON_USEDEP}]
+	)
+"
+
+DOCS=( README.rst )
+
+PATCHES=(
+	"${FILESDIR}/${P}-unbundle-bottle.patch"
+)
+
+distutils_enable_tests pytest
+
+src_prepare() {
+	# remove bundled bottle (sic!)
+	rm pypiserver/bottle.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
+		# TODO
+		tests/test_app.py::test_root_count
+		tests/test_server.py::test_pip_install_open_succeeds
+		tests/test_server.py::test_pip_install_authed_succeeds
+	)
+
+	epytest tests
+}


             reply	other threads:[~2022-05-24  6:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-24  6:16 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-14 10:57 [gentoo-commits] repo/gentoo:master commit in: dev-python/pypiserver/, dev-python/pypiserver/files/ Michał Górny
2024-11-24  3:28 Michał Górny
2024-04-25 12:52 Michał Górny
2019-11-22  3:15 Patrick McLean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1653372940.4a6866d7bbbed4216bad68bf33a1e0100c5ee9e5.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox