summaryrefslogtreecommitdiff
path: root/dev-python/pypiserver/files/pypiserver-2.3.1-unbundle-bottle.patch
blob: c879e5291a8894f61accc7b3d136497352b11623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
From 65c42e562500590d4e2377479ce23c4bcf4c325c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
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