Drop support for Python 3.8

This commit is contained in:
rlaphoenix 2023-02-22 03:43:22 +00:00
parent f21aa5aac5
commit c1f716cb6c
20 changed files with 6 additions and 44 deletions

View File

@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3

View File

@ -10,7 +10,7 @@
<img src="https://github.com/devine-dl/devine/actions/workflows/ci.yml/badge.svg" alt="Build status">
</a>
<a href="https://python.org">
<img src="https://img.shields.io/badge/python-3.8.6%2B-informational" alt="Python version">
<img src="https://img.shields.io/badge/python-3.9.0%2B-informational" alt="Python version">
</a>
<a href="https://deepsource.io/gh/devine-dl/devine/?ref=repository-badge">
<img src="https://deepsource.io/gh/devine-dl/devine.svg/?label=active+issues&token=1ADCbjJ3FPiGT_s0Y0rlugGU" alt="DeepSource">

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import logging
import re
from pathlib import Path

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import logging
from pathlib import Path
from typing import Optional

View File

@ -1,5 +1,3 @@
from __future__ import annotations
from typing import Optional
import click

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import asyncio
import subprocess
from pathlib import Path

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import subprocess
from pathlib import Path
from typing import Optional, Union

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import random
import re
import subprocess

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import json
import re
from typing import Optional

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import base64
import logging
from abc import ABCMeta, abstractmethod

View File

@ -1,5 +1,3 @@
from __future__ import annotations
from pathlib import Path
import click

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import re
import shutil
import subprocess

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import ast
import contextlib
import importlib.util
@ -22,12 +20,6 @@ from devine.core.config import config
from devine.core.constants import LANGUAGE_MAX_DISTANCE
def is_relative_to_backport(base: Path, path_: Union[Path, str]) -> bool:
"""Same as Path.is_relative_to, but back-ported to 3.8.x."""
path_ = Path(path_)
return path_ == base or path_ in base.parents
def import_module_by_path(path: Path) -> ModuleType:
"""Import a Python file by Path as a Module."""
if not path:
@ -38,7 +30,7 @@ def import_module_by_path(path: Path) -> ModuleType:
raise ValueError("Path does not exist")
# compute package hierarchy for relative import support
if is_relative_to_backport(path, config.directories.core_dir):
if path.is_relative_to(config.directories.core_dir):
name = []
_path = path.parent
while _path.stem != config.directories.core_dir.stem:

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import re
from typing import Optional, Union

View File

@ -1,5 +1,3 @@
from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import Iterator, Optional, Union
from uuid import UUID

View File

@ -1,5 +1,3 @@
from __future__ import annotations
from typing import Any, Iterator, Optional, Union
from uuid import UUID

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import threading
from typing import Iterator, Optional, Union
from uuid import UUID

View File

@ -1,5 +1,3 @@
from __future__ import annotations
import sqlite3
import threading
from pathlib import Path

4
poetry.lock generated
View File

@ -1722,5 +1722,5 @@ multidict = ">=4.0"
[metadata]
lock-version = "2.0"
python-versions = ">=3.8.6,<3.12"
content-hash = "a5ae30165f979359df7f0a2ff60822904261657d7c89acd5f5fba94643325e64"
python-versions = ">=3.9.0,<3.12"
content-hash = "cb2c53f75ffcbfcbea3341e1300a1e054c87b85343fa21e606287518ad5c142d"

View File

@ -23,7 +23,7 @@ classifiers = [
]
[tool.poetry.dependencies]
python = ">=3.8.6,<3.12"
python = ">=3.9.0,<3.12"
appdirs = "^1.4.4"
Brotli = "^1.0.9"
click = "^8.1.3"