Skip to content

Commit ddc96d4

Browse files
abhinavsinghPh0tonicpre-commit-ci[bot]
authored
Update project test dependencies to ensure green workflow (#1371)
* Use www.google.com for http2 tests * Update README.md Add missing tutorial's link (cherry picked from commit e459f93) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * System packages for readthedocs * Pin pyyaml, see https://github.com/yaml/pyyaml/issues/724\#issuecomment-1638587228 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Ignore flake8 S507 * precommit `pyyaml==5.3.1` * follow yaml/pyyaml#724 * pin to essentials_openapi==0.1.4 for blacksheep * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove blacksheep dep * remove system_packages * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Check if tox upgrade helps with `ERROR: FAIL could not package project ` tox related issues * Fix links * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use `importlib.metadata` instead of `pkg_resources` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Just remove link from plugin docstring for now * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * pin `sphinxcontrib-applehelp==1.0.2` which is breaking spellcheck * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Pin `sphinxcontrib-*` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * pin `towncrier` too * add kwargs as a spelling * `_get_dist` backward compatible with 3.6 * Use `httpbingo.org` instead of `httpbin.org` in tests making network requests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use `httpbingo` for reverse proxy plugin too which is tested in workflows * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * `importlib-metadata; python_version <= 3.7` * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Integration test changes due to usage of httpbingo instead of httpbin * `importlib-metadata; python_version <= 3.7` moved to build essentials and bypass reverse proxy integration test result verification for now * Filter and ignore `DeprecationWarning` to make it work on 3.7 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * with deprecation ignore we dont need `importlib-metadata` --------- Co-authored-by: Wermeille Bastien <bastien.wermeille@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 30574fd commit ddc96d4

26 files changed

+142
-97
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ extend-ignore =
188188
WPS613 # FIXME: unmatching super method access
189189
WPS615 # FIXME: unpythonic setter/getter
190190
PT027 # FIXME: use pytest.raises() instead of unittest-style 'assertRaises'
191+
S507 # FIXME: Paramiko call with policy set to automatically trust the unknown host key
191192

192193
# https://wemake-python-stylegui.de/en/latest/pages/usage/formatter.html
193194
format = wemake

.github/workflows/test-library.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ jobs:
263263
python -m
264264
pip install
265265
--user
266-
tox==3.25.1
266+
tox==3.28.0
267267
268268
- name: Grab the source from Git
269269
uses: actions/checkout@v3
@@ -388,7 +388,7 @@ jobs:
388388
python -m
389389
pip install
390390
--user
391-
tox==3.25.1
391+
tox==3.28.0
392392
393393
- name: Grab the source from Git
394394
uses: actions/checkout@v3
@@ -505,7 +505,7 @@ jobs:
505505
python -m
506506
pip install
507507
--user
508-
tox==3.25.1
508+
tox==3.28.0
509509
510510
- name: Grab the source from Git
511511
uses: actions/checkout@v3

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ repos:
159159
- paramiko == 2.11.0
160160
- types-paramiko == 2.7.3
161161
- types-requests==2.27.30
162+
# From requirements-tunnel.txt
162163
- cryptography==36.0.2; python_version <= '3.6'
163164
- types-setuptools == 57.4.2
165+
- pyyaml==5.3.1
164166
args:
165167
# FIXME: get rid of missing imports ignore
166168
- --ignore-missing-imports

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ build:
3131
# Optionally set the version of Python and requirements required
3232
# to build docs
3333
python:
34+
# system_packages: false
3435
install:
3536
- method: pip
3637
path: .
3738
- requirements: requirements-tunnel.txt
3839
- requirements: docs/requirements.txt
39-
system_packages: false
4040

4141
...

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"editor.formatOnSaveMode": "modifications",
44
"editor.formatOnSave": true,
55
"editor.codeActionsOnSave": {
6-
"source.fixAll": true
6+
"source.fixAll": "explicit"
77
},
88
"[yaml]": {
99
"editor.insertSpaces": true,
@@ -18,7 +18,7 @@
1818
"typescript.format.semicolons": "remove",
1919
"typescript.preferences.quoteStyle": "single",
2020
"[python]": {
21-
"editor.wordBasedSuggestions": true,
21+
"editor.wordBasedSuggestions": "matchingDocuments",
2222
"editor.defaultFormatter": null
2323
},
2424
"python.testing.unittestEnabled": false,

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195

196196
Consult [Threads vs Threadless](#threads-vs-threadless) and [Threadless Remote vs Local Execution Mode](#threadless-remote-vs-local-execution-mode) to control number of CPU cores utilized.
197197

198-
See [Benchmark](https://github.com/abhinavsingh/proxy.py/tree/develop/benchmark#readme) for more details and for how to run benchmarks locally.
198+
See [Benchmark](https://github.com/abhinavsingh/proxy.py/blob/develop/benchmark/README.md) for more details and for how to run benchmarks locally.
199199

200200
- Lightweight
201201
- Uses only `~5-20 MB` RAM
@@ -2366,7 +2366,7 @@ usage: -m [-h] [--tunnel-hostname TUNNEL_HOSTNAME] [--tunnel-port TUNNEL_PORT]
23662366
[--filtered-client-ips FILTERED_CLIENT_IPS]
23672367
[--filtered-url-regex-config FILTERED_URL_REGEX_CONFIG]
23682368

2369-
proxy.py v2.4.4rc4.dev6+g4ee982a.d20221022
2369+
proxy.py v2.4.4rc5.dev36+g6c9d0315.d20240411
23702370

23712371
options:
23722372
-h, --help show this help message and exit

benchmark/_blacksheep.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@
99
:license: BSD, see LICENSE for more details.
1010
"""
1111
import uvicorn
12-
from blacksheep.server import Application
13-
from blacksheep.server.responses import text
1412

1513

16-
app = Application()
14+
# from blacksheep.server import Application
15+
# from blacksheep.server.responses import text
1716

1817

19-
@app.route('/http-route-example')
18+
# app = Application()
19+
20+
21+
# @app.route('/http-route-example')
2022
async def home(request): # type: ignore[no-untyped-def]
21-
return text('HTTP route response')
23+
# return text('HTTP route response')
24+
pass
2225

2326
if __name__ == '__main__':
2427
uvicorn.run('server:app', port=9000, workers=10, log_level='warning')

benchmark/requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
aiohttp==3.8.1
2-
blacksheep==1.2.7
2+
# Blacksheep depends upon essentials_openapi which is pinned to pyyaml==5.4.1
3+
# and pyyaml>5.3.1 is broken for cython 3
4+
# See https://github.com/yaml/pyyaml/issues/724#issuecomment-1638587228
5+
# blacksheep==1.2.7
36
starlette==0.19.1
47
tornado==6.1
58
uvicorn==0.16.0

docs/_ext/spelling_stub_ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Sphinx extension for making the spelling directive noop."""
22

3-
from typing import List
3+
from typing import Any, Dict, List
44

55
from sphinx.util.nodes import nodes
66
from sphinx.application import Sphinx
@@ -17,7 +17,7 @@ def run(self) -> List[nodes.Node]:
1717
return []
1818

1919

20-
def setup(app: Sphinx) -> None:
20+
def setup(app: Sphinx) -> Dict[str, Any]:
2121
"""Initialize the extension."""
2222
app.add_directive('spelling', SpellingNoOpDirective)
2323

docs/requirements.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,15 @@ Sphinx == 4.3.2
44
furo >= 2021.11.15
55
sphinxcontrib-apidoc >= 0.3.0
66
sphinxcontrib-towncrier >= 0.2.0a0
7+
# See https://github.com/yaml/pyyaml/issues/724#issuecomment-1638587228
8+
pyyaml==5.3.1
9+
# PIN to fix:
10+
# The sphinxcontrib.applehelp extension used by this project needs at least Sphinx v5.0;
11+
# it therefore cannot be built with this version.
12+
sphinxcontrib-applehelp==1.0.2
13+
sphinxcontrib-devhelp==1.0.2
14+
sphinxcontrib-htmlhelp==2.0.0
15+
sphinxcontrib-qthelp==1.0.3
16+
sphinxcontrib-serializinghtml==1.1.5
17+
sphinxcontrib-towncrier==0.2.1a0
18+
towncrier==21.3.0

docs/requirements.txt

Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.10
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.10
3+
# by the following command:
44
#
55
# pip-compile --allow-unsafe --generate-hashes --output-file=docs/requirements.txt --strip-extras docs/requirements.in
66
#
@@ -31,7 +31,9 @@ charset-normalizer==2.0.7 \
3131
click==8.0.3 \
3232
--hash=sha256:353f466495adaeb40b6b5f592f9f91cb22372351c84caeb068132442a4518ef3 \
3333
--hash=sha256:410e932b050f5eed773c4cda94de75971c89cdb3155a72a0831139a79e5ecb5b
34-
# via towncrier
34+
# via
35+
# click-default-group
36+
# towncrier
3537
click-default-group==1.2.2 \
3638
--hash=sha256:d9560e8e8dfa44b3562fbc9425042a0fd6d21956fcc2db0077f63f34253ab904
3739
# via towncrier
@@ -44,7 +46,7 @@ docutils==0.17.1 \
4446
furo==2022.4.7 \
4547
--hash=sha256:7f3e3d2fb977483590f8ecb2c2cd511bd82661b79c18efb24de9558bc9cdf2d7 \
4648
--hash=sha256:96204ab7cd047e4b6c523996e0279c4c629a8fc31f4f109b2efd470c17f49c80
47-
# via -r requirements.in
49+
# via -r docs/requirements.in
4850
idna==3.3 \
4951
--hash=sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff \
5052
--hash=sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d
@@ -152,7 +154,7 @@ mdit-py-plugins==0.3.0 \
152154
myst-parser==0.17.2 \
153155
--hash=sha256:1635ce3c18965a528d6de980f989ff64d6a1effb482e1f611b1bfb79e38f3d98 \
154156
--hash=sha256:4c076d649e066f9f5c7c661bae2658be1ca06e76b002bb97f02a09398707686c
155-
# via -r requirements.in
157+
# via -r docs/requirements.in
156158
packaging==21.2 \
157159
--hash=sha256:096d689d78ca690e4cd8a89568ba06d07ca097e3306a4381635073ca91479966 \
158160
--hash=sha256:14317396d1e8cdb122989b916fa2c7e9ca8e2be9e8060a6eff75b6b7b4d8a7e0
@@ -177,49 +179,31 @@ pytz==2021.3 \
177179
--hash=sha256:3672058bc3453457b622aab7a1c3bfd5ab0bdae451512f6cf25f64ed37f5b87c \
178180
--hash=sha256:acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326
179181
# via babel
180-
pyyaml==6.0 \
181-
--hash=sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293 \
182-
--hash=sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b \
183-
--hash=sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57 \
184-
--hash=sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b \
185-
--hash=sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4 \
186-
--hash=sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07 \
187-
--hash=sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba \
188-
--hash=sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9 \
189-
--hash=sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287 \
190-
--hash=sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513 \
191-
--hash=sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0 \
192-
--hash=sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0 \
193-
--hash=sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92 \
194-
--hash=sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f \
195-
--hash=sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2 \
196-
--hash=sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc \
197-
--hash=sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c \
198-
--hash=sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86 \
199-
--hash=sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4 \
200-
--hash=sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c \
201-
--hash=sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34 \
202-
--hash=sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b \
203-
--hash=sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c \
204-
--hash=sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb \
205-
--hash=sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737 \
206-
--hash=sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3 \
207-
--hash=sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d \
208-
--hash=sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53 \
209-
--hash=sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78 \
210-
--hash=sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803 \
211-
--hash=sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a \
212-
--hash=sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174 \
213-
--hash=sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5
214-
# via myst-parser
182+
pyyaml==5.3.1 \
183+
--hash=sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97 \
184+
--hash=sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76 \
185+
--hash=sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2 \
186+
--hash=sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e \
187+
--hash=sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648 \
188+
--hash=sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf \
189+
--hash=sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f \
190+
--hash=sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2 \
191+
--hash=sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee \
192+
--hash=sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a \
193+
--hash=sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d \
194+
--hash=sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c \
195+
--hash=sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a
196+
# via
197+
# -r docs/requirements.in
198+
# myst-parser
215199
requests==2.26.0 \
216200
--hash=sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24 \
217201
--hash=sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7
218202
# via sphinx
219203
setuptools-scm==6.3.2 \
220204
--hash=sha256:4c64444b1d49c4063ae60bfe1680f611c8b13833d556fd1d6050c0023162a119 \
221205
--hash=sha256:a49aa8081eeb3514eb9728fa5040f2eaa962d6c6f4ec9c32f6c1fba88f88a0f2
222-
# via -r requirements.in
206+
# via -r docs/requirements.in
223207
snowballstemmer==2.1.0 \
224208
--hash=sha256:b51b447bea85f9968c13b650126a888aabd4cb4463fca868ec596826325dedc2 \
225209
--hash=sha256:e997baa4f2e9139951b6f4c631bad912dfd3c792467e2f03d7239464af90e914
@@ -232,43 +216,53 @@ sphinx==4.3.2 \
232216
--hash=sha256:0a8836751a68306b3fe97ecbe44db786f8479c3bf4b80e3a7f5c838657b4698c \
233217
--hash=sha256:6a11ea5dd0bdb197f9c2abc2e0ce73e01340464feaece525e64036546d24c851
234218
# via
235-
# -r requirements.in
219+
# -r docs/requirements.in
236220
# furo
237221
# myst-parser
238222
# sphinxcontrib-apidoc
239223
# sphinxcontrib-towncrier
240224
sphinxcontrib-apidoc==0.3.0 \
241225
--hash=sha256:6671a46b2c6c5b0dca3d8a147849d159065e50443df79614f921b42fbd15cb09 \
242226
--hash=sha256:729bf592cf7b7dd57c4c05794f732dc026127275d785c2a5494521fdde773fb9
243-
# via -r requirements.in
227+
# via -r docs/requirements.in
244228
sphinxcontrib-applehelp==1.0.2 \
245229
--hash=sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a \
246230
--hash=sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58
247-
# via sphinx
231+
# via
232+
# -r docs/requirements.in
233+
# sphinx
248234
sphinxcontrib-devhelp==1.0.2 \
249235
--hash=sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e \
250236
--hash=sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4
251-
# via sphinx
237+
# via
238+
# -r docs/requirements.in
239+
# sphinx
252240
sphinxcontrib-htmlhelp==2.0.0 \
253241
--hash=sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07 \
254242
--hash=sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2
255-
# via sphinx
243+
# via
244+
# -r docs/requirements.in
245+
# sphinx
256246
sphinxcontrib-jsmath==1.0.1 \
257247
--hash=sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178 \
258248
--hash=sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8
259249
# via sphinx
260250
sphinxcontrib-qthelp==1.0.3 \
261251
--hash=sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72 \
262252
--hash=sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6
263-
# via sphinx
253+
# via
254+
# -r docs/requirements.in
255+
# sphinx
264256
sphinxcontrib-serializinghtml==1.1.5 \
265257
--hash=sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd \
266258
--hash=sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952
267-
# via sphinx
259+
# via
260+
# -r docs/requirements.in
261+
# sphinx
268262
sphinxcontrib-towncrier==0.2.1a0 \
269263
--hash=sha256:a6fac6091a8ee12664d9b1f50a1504cb662380bf8d3bd0f267ebbf4483aa9c18 \
270264
--hash=sha256:b15ee84aa6288173487988514b589155ef38ac6c55ab014a774102f9dc884f41
271-
# via -r requirements.in
265+
# via -r docs/requirements.in
272266
toml==0.10.2 \
273267
--hash=sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b \
274268
--hash=sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f
@@ -280,7 +274,9 @@ tomli==1.2.2 \
280274
towncrier==21.3.0 \
281275
--hash=sha256:6eed0bc924d72c98c000cb8a64de3bd566e5cb0d11032b73fcccf8a8f956ddfe \
282276
--hash=sha256:e6ccec65418bbcb8de5c908003e130e37fe0e9d6396cb77c1338241071edc082
283-
# via sphinxcontrib-towncrier
277+
# via
278+
# -r docs/requirements.in
279+
# sphinxcontrib-towncrier
284280
typing-extensions==4.2.0 \
285281
--hash=sha256:6657594ee297170d19f67d55c05852a874e7eb634f4f753dbd667855e07c1708 \
286282
--hash=sha256:f1c24655a0da0d1b67f07e17a5e6b2a105894e6824b92096378bb3668ef02376

docs/spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
kwargs
12
IPv
23
Nginx
34
Pluggable

proxy/common/_version.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,31 @@
1313
from typing import Tuple, Union
1414

1515

16+
def _get_dist(distribution_name: str) -> str:
17+
# pylint: disable=import-outside-toplevel
18+
import warnings
19+
20+
try:
21+
# pylint: disable=import-outside-toplevel
22+
from importlib.metadata import version # noqa: WPS433
23+
24+
return version(distribution_name)
25+
except ModuleNotFoundError: # pragma: no cover
26+
with warnings.catch_warnings():
27+
warnings.filterwarnings('ignore', category=DeprecationWarning)
28+
29+
# pylint: disable=import-outside-toplevel
30+
from pkg_resources import get_distribution # noqa: WPS433
31+
32+
return get_distribution(distribution_name).version
33+
34+
1635
try:
1736
# pylint: disable=unused-import
1837
from ._scm_version import version as __version__ # noqa: WPS433, WPS436
1938
from ._scm_version import version_tuple as _ver_tup # noqa: WPS433, WPS436
20-
except ImportError: # pragma: no cover
21-
from pkg_resources import get_distribution as _get_dist # noqa: WPS433
22-
__version__ = _get_dist('proxy.py').version # noqa: WPS440
39+
except ImportError: # pragma: no cover
40+
__version__ = _get_dist('proxy.py') # noqa: WPS440
2341

2442

2543
def _to_int_or_str(inp: str) -> Union[int, str]: # pragma: no cover

proxy/plugin/reverse_proxy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def routes(self) -> List[Union[str, Tuple[str, List[bytes]]]]:
4141
# A static route
4242
(
4343
r'/get$',
44-
[b'http://httpbin.org/get', b'https://httpbin.org/get'],
44+
[b'http://httpbingo.org/get', b'https://httpbingo.org/get'],
4545
),
4646
# A dynamic route to catch requests on "/get/<int>""
4747
# See "handle_route" method below for what we do when
@@ -53,7 +53,7 @@ def handle_route(self, request: HttpParser, pattern: RePattern) -> Url:
5353
"""For our example dynamic route, we want to simply convert
5454
any incoming request to "/get/1" into "/get?id=1" when serving from upstream.
5555
"""
56-
choice: Url = Url.from_bytes(b'http://httpbin.org/get')
56+
choice: Url = Url.from_bytes(b'http://httpbingo.org/get')
5757
assert request.path
5858
result = re.search(pattern, request.path.decode())
5959
if not result or len(result.groups()) != 1:

0 commit comments

Comments
 (0)