Skip to content

Commit 27f43aa

Browse files
committed
Remove 3.6 support
Signed-off-by: Bernát Gábor <[email protected]>
1 parent e81caba commit 27f43aa

File tree

8 files changed

+27
-23
lines changed

8 files changed

+27
-23
lines changed

.github/workflows/check.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ jobs:
2828
- 3.9
2929
- 3.8
3030
- 3.7
31-
- 3.6
32-
- pypy3
31+
- pypy-3.7-v7.3.5
3332
steps:
3433
- name: Setup python for tox
3534
uses: actions/setup-python@v2
@@ -47,7 +46,7 @@ jobs:
4746
import subprocess; import json; import os
4847
major, minor, impl = json.loads(subprocess.check_output(["python", "-c", "import json; import sys; import platform; print(json.dumps([sys.version_info[0], sys.version_info[1], platform.python_implementation()]));"], universal_newlines=True))
4948
with open(os.environ["GITHUB_ENV"], "a") as file_handler:
50-
file_handler.write("TOXENV=" + (f'py{major}{minor}' if impl == "CPython" else f'pypy{major}') + "\n")
49+
file_handler.write("TOXENV=" + (f'py{major}{minor}' if impl == "CPython" else f'pypy{major}{minor}') + "\n")
5150
shell: python
5251
- name: Setup test suite
5352
run: tox -vv --notest

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ repos:
1515
rev: v2.29.0
1616
hooks:
1717
- id: pyupgrade
18+
args: ["--py37-plus"]
1819
- repo: https://github.com/PyCQA/isort
1920
rev: 5.9.3
2021
hooks:

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ testpaths = tests
9898
junit_family = xunit2
9999

100100
[mypy]
101-
python_version = 3.6
101+
python_version = 3.7
102102
disallow_any_generics = True
103103
disallow_subclassing_any = True
104104
disallow_untyped_calls = True

src/devpi_process/__init__.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import random
24
import socket
35
import string
@@ -8,13 +10,13 @@
810
from subprocess import PIPE, Popen, check_call
911
from threading import Thread
1012
from types import TracebackType
11-
from typing import IO, Dict, Iterator, List, Optional, Sequence, Type, cast
13+
from typing import IO, Iterator, Sequence, cast
1214

1315
from .version import __version__
1416

1517

1618
class Index:
17-
def __init__(self, base_url: str, name: str, user: str, client_cmd_base: List[str]) -> None:
19+
def __init__(self, base_url: str, name: str, user: str, client_cmd_base: list[str]) -> None:
1820
self._client_cmd_base = client_cmd_base
1921
self._server_url = base_url
2022
self.name = name
@@ -36,7 +38,7 @@ def __repr__(self) -> str:
3638

3739

3840
class IndexServer:
39-
def __init__(self, path: Path, with_root_pypi: bool = False, start_args: Optional[Sequence[str]] = None) -> None:
41+
def __init__(self, path: Path, with_root_pypi: bool = False, start_args: Sequence[str] | None = None) -> None:
4042
self.path = path
4143
self._with_root_pypi = with_root_pypi
4244
self._start_args: Sequence[str] = [] if start_args is None else start_args
@@ -57,16 +59,16 @@ def _exe(name: str) -> str:
5759

5860
self._server_dir = self.path / "server"
5961
self._client_dir = self.path / "client"
60-
self._indexes: Dict[str, Index] = {}
61-
self._process: Optional["Popen[str]"] = None
62+
self._indexes: dict[str, Index] = {}
63+
self._process: Popen[str] | None = None
6264
self._has_use = False
63-
self._stdout_drain: Optional[Thread] = None
65+
self._stdout_drain: Thread | None = None
6466

6567
@property
6668
def user(self) -> str:
6769
return "root"
6870

69-
def __enter__(self) -> "IndexServer":
71+
def __enter__(self) -> IndexServer:
7072
self._create_and_start_server()
7173
self._setup_client()
7274
return self
@@ -124,9 +126,9 @@ def create_index(self, name: str, *args: str) -> Index:
124126

125127
def __exit__(
126128
self,
127-
exc_type: Optional[Type[BaseException]], # noqa: U100
128-
exc_val: Optional[BaseException], # noqa: U100
129-
exc_tb: Optional[TracebackType], # noqa: U100
129+
exc_type: type[BaseException] | None, # noqa: U100
130+
exc_val: BaseException | None, # noqa: U100
131+
exc_tb: TracebackType | None, # noqa: U100
130132
) -> None:
131133
if self._process is not None: # pragma: no cover # defend against devpi startup fail
132134
self._process.terminate()

src/pytest_devpi/version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
""" Version information """
2+
from __future__ import annotations
23

34
__version__ = "0.1.dev1+gc78a9e3.d20210617"

tests/demo_pkg_inline/build.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
from __future__ import annotations
2+
13
import os
24
import sys
35
import tarfile
46
from io import BytesIO
57
from textwrap import dedent
6-
from typing import List, Optional
78
from zipfile import ZipFile
89

910
name = "demo_pkg_inline"
@@ -55,7 +56,7 @@
5556

5657
def build_wheel(
5758
wheel_directory: str,
58-
metadata_directory: Optional[str] = None, # noqa: U100
59+
metadata_directory: str | None = None, # noqa: U100
5960
config_settings: None = None, # noqa: U100
6061
) -> str:
6162
base_name = f"{name}-{version}-py{sys.version_info[0]}-none-any.whl"
@@ -68,7 +69,7 @@ def build_wheel(
6869

6970
def get_requires_for_build_wheel(
7071
config_settings: None = None, # noqa: U100
71-
) -> List[str]:
72+
) -> list[str]:
7273
return [] # pragma: no cover # only executed in non-host pythons
7374

7475

@@ -92,5 +93,5 @@ def build_sdist(
9293

9394
def get_requires_for_build_sdist(
9495
config_settings: None = None, # noqa: U100
95-
) -> List[str]:
96+
) -> list[str]:
9697
return [] # pragma: no cover # only executed in non-host pythons

tests/test_devpi_process.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
from __future__ import annotations
2+
13
from importlib.util import module_from_spec, spec_from_file_location
24
from pathlib import Path
3-
from typing import Tuple
45

56
import pytest
67
from _pytest.tmpdir import TempPathFactory
@@ -16,7 +17,7 @@ def test_version() -> None:
1617

1718

1819
@pytest.fixture(scope="session")
19-
def demo_artifacts(tmp_path_factory: TempPathFactory) -> Tuple[Path, Path]:
20+
def demo_artifacts(tmp_path_factory: TempPathFactory) -> tuple[Path, Path]:
2021
spec = spec_from_file_location("demo_pkg_inline.build", str(Path(__file__).parent / "demo_pkg_inline" / "build.py"))
2122
assert spec is not None
2223
build = module_from_spec(spec)
@@ -29,7 +30,7 @@ def demo_artifacts(tmp_path_factory: TempPathFactory) -> Tuple[Path, Path]:
2930
return wheel, sdist
3031

3132

32-
def test_create_server(tmp_path: Path, demo_artifacts: Tuple[Path, Path]) -> None:
33+
def test_create_server(tmp_path: Path, demo_artifacts: tuple[Path, Path]) -> None:
3334
with IndexServer(tmp_path) as server:
3435
assert repr(server)
3536
state = get(server.url).json()["result"]["root"]

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ envlist =
55
py39
66
py38
77
py37
8-
py36
9-
pypy3
8+
pypy37
109
type
1110
pkg_desc
1211
isolated_build = true

0 commit comments

Comments
 (0)