Skip to content

Commit

Permalink
chore: drop Python 3.7 & 3.8 support
Browse files Browse the repository at this point in the history
Signed-off-by: Rongrong <[email protected]>
  • Loading branch information
Rongronggg9 committed Nov 4, 2023
1 parent 3f69fb0 commit b5680cb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rough-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
version: [ '3.9', '3.10', '3.11' ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
name: Python ${{ matrix.version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down
12 changes: 6 additions & 6 deletions docs/deployment-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ _Please note that if you deploy RSStT without using the above buttons, you must

> RSStT is tested only under the recommended system requirements.
| | **Minimum** | **Recommended** |
|----------------------|---------------------------|-----------------|
| **Operating system** | Linux, Windows, macOS | Linux |
| **Architecture** | x86_64, arm64 | x86_64 |
| **Python** | 3.7 (x86_64), 3.8 (arm64) | 3.9, 3.10 |
| **Free memory** | 128MB | \> 384MB |
| | **Minimum** | **Recommended** |
|----------------------|-----------------------|-----------------|
| **Operating system** | Linux, Windows, macOS | Linux |
| **Architecture** | x86_64, arm64 | x86_64 |
| **Python** | 3.9 | 3.11 |
| **Free memory** | 128MB | \> 384MB |

### Prerequisites

Expand Down
10 changes: 4 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ beautifulsoup4==4.12.2
lxml==4.9.3
rapidfuzz==3.2.0
emoji==2.8.0
minify-html==0.6.10; python_version<="3.7" # 0.6.10 for Python 3.7 (amd64 only)
minify-html==0.10.8; python_version>="3.8" # Python 3.8+ (aarch64/amd64 only)
minify-html-onepass==0.10.8; python_version>="3.8" # Python 3.8+ (aarch64/amd64 only)
matplotlib==3.5.3; python_version<="3.7"
matplotlib==3.7.2; python_version>="3.8"
minify-html==0.10.8
minify-html-onepass==0.10.8
matplotlib==3.7.2

# db
asyncpg==0.28.0
Expand All @@ -39,4 +37,4 @@ asyncstdlib==3.10.9
cachetools==5.3.1
CJKwrap==2.2
typing-extensions==4.7.1
uvloop==0.17.0; python_version>="3.7" and sys_platform!='win32' and sys_platform!='cygwin' and sys_platform!='cli'
uvloop==0.17.0; sys_platform!='win32' and sys_platform!='cygwin' and sys_platform!='cli'
4 changes: 1 addition & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ classifiers =
Operating System :: Microsoft :: Windows
Operating System :: MacOS
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Expand All @@ -38,7 +36,7 @@ install_requires = requirements.txt

[options]
zip_safe = False
python_requires = >=3.7
python_requires = >=3.9

[options.package_data]
* = *.json, *.opml, *.sql, *.txt
Expand Down
9 changes: 3 additions & 6 deletions src/compat.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
"""Containing something makes the bot compatible with Python 3.7 ~ 3.10, ThreadPoolExecutor/ProcessPoolExecutor."""
from __future__ import annotations

import sys

_version_info = sys.version_info
if _version_info < (3, 7):
raise RuntimeError("This bot requires Python 3.7 or later")
if _version_info < (3, 9):
raise RuntimeError("This bot requires Python 3.9 or later")

from typing import Callable

Expand All @@ -24,7 +23,7 @@
import ssl
from contextlib import AbstractContextManager, AbstractAsyncContextManager, suppress

# backport `contextlib.nullcontext` for Python 3.7 ~ 3.9
# backport `contextlib.nullcontext` for Python 3.9
if _version_info[1] >= 10:
# noinspection PyUnresolvedReferences
from contextlib import nullcontext
Expand Down Expand Up @@ -121,8 +120,6 @@ def parsing_utils_html_validator_minify(html: str) -> str:
if (
minify_html_onepass is None # requires minify-html-onepass to workaround upstream issue
or
_version_info[1] < 8 # minify-html >0.6.10 requires Python 3.8+
or
contains_sr_only # clear sr-only first, otherwise minify-html cannot strip spaces around them
):
html = _parsing_utils_html_validator_minify_preprocess(html, contains_sr_only)
Expand Down
4 changes: 2 additions & 2 deletions src/parsing/html_node.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from __future__ import annotations
from typing import Optional, Union, List
from typing import Optional, Union

from url_normalize import url_normalize

__all__ = ["HtmlTree", "Text", "Link", "Bold", "Italic", "Underline", "Strike", "Code", "Pre", "Br", "Hr",
"ListItem", "OrderedList", "UnorderedList", "TypeTextContent"]

TypeTextContent = Union["Text", str, List["Text"]] # list["SomeType"] not compatible with Python 3.7
TypeTextContent = Union["Text", str, list["Text"]]


class Text:
Expand Down

0 comments on commit b5680cb

Please sign in to comment.