From 2cf06ca58f7608224a8803233661415c7a2c9b8d Mon Sep 17 00:00:00 2001 From: Eugene Molotov Date: Sat, 16 Dec 2023 12:09:33 +0000 Subject: [PATCH] bump starlette to 0.27.0 and minimal python version to 3.7 Since python 3.6 reached EOL [1] and starlette having several vulnerabities [2][3][4] that are fixed in version, where python 3.6 is not supported, we bump to minimal python to 3.7. [1] https://devguide.python.org/versions/ [2] https://github.com/advisories/GHSA-v5gw-mw7f-84px [3] https://github.com/advisories/GHSA-3qj8-93xh-pwh2 [4] https://github.com/advisories/GHSA-74m5-2c7w-9w3x --- .github/workflows/build.yml | 3 --- README.md | 2 +- qllr/templating.py | 5 +---- requirements.txt | 2 +- requirements_dev.txt | 1 + 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e0e3e29..a6f4dd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,9 +12,6 @@ jobs: matrix: python-version: ["3.12", "3.11", "3.10", "3.9", "3.8", "3.7"] os: ["ubuntu-22.04"] - include: - - python-version: "3.6" - os: "ubuntu-20.04" runs-on: ${{ matrix.os }} steps: diff --git a/README.md b/README.md index 460d963..7d347e7 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Usually it is used with [feeder](https://github.com/em92/qlstats-feeder-mini) ba For qllr itself: -* Python 3.6 with pip +* Python 3.7 with pip * PostgreSQL 9.5 For feeder: diff --git a/qllr/templating.py b/qllr/templating.py index 1faee86..8162ca6 100644 --- a/qllr/templating.py +++ b/qllr/templating.py @@ -30,10 +30,7 @@ def url_for(context: dict, name: str, **path_params: typing.Any) -> str: for k, v in path_params.items() if not isinstance(v, Undefined) and v is not None } - # NOTE: take this stupid hack away, when url_for returns relative path - absolute_url = request.url_for(name, **path_params) - parsed_absolute_url = urlparse(absolute_url) - return ParseResult("", "", *parsed_absolute_url[2:]).geturl() + return str(request.app.url_path_for(name, **path_params)) super().__init__(directory) self.env.filters["ql_nickname"] = render_ql_nickname diff --git a/requirements.txt b/requirements.txt index 2b1b77a..2fdf1a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ psycopg2==2.9.1; python_version < '3.11' psycopg2==2.9.9; python_version >= '3.11' trueskill==0.4.4 -starlette==0.16.0 +starlette==0.27.0; asyncpg==0.24.0; python_version < '3.11' asyncpg==0.29.0; python_version >= '3.11' uvicorn==0.14.0 diff --git a/requirements_dev.txt b/requirements_dev.txt index 3065742..2f61f1c 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -5,5 +5,6 @@ pytest-cov git+https://github.com/BrandonNav/testing.postgresql@f849c786eaa9d2c0ff8b2a5f3fb21e96742ec8b6 pylint flake8 +httpx isort==5.* black==22.3.0