Skip to content

Commit d936a4e

Browse files
committed
Fix errors on Python 3.8 due to types
1 parent 57f5def commit d936a4e

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- uses: astral-sh/setup-uv@v6
3131
with:
3232
python-version: ${{ matrix.python }}
33+
python-preference: "only-managed"
3334
- name: Install solc-select and test dependencies
3435
run: |
3536
uv sync --extra dev

solc_select/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import argparse
22
import sys
3+
from typing import List
34

45
from .constants import (
56
INSTALL_COMMAND,
@@ -22,7 +23,7 @@
2223
from .utils import sort_versions
2324

2425

25-
def solc_select_install(service: SolcService, versions: list[str]) -> None:
26+
def solc_select_install(service: SolcService, versions: List[str]) -> None:
2627
"""Handle the install command."""
2728
if not versions:
2829
print("Available versions to install:")

solc_select/infrastructure/http_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
retry logic and proper timeout handling.
66
"""
77

8-
from typing import Any, Mapping, Optional, Union
8+
from typing import Any, Mapping, Optional, Tuple, Union
99

1010
import requests
1111
from requests.adapters import HTTPAdapter
@@ -22,9 +22,9 @@ def send(
2222
self,
2323
request: PreparedRequest,
2424
stream: bool = False,
25-
timeout: Union[float, tuple[float, float], tuple[float, None], None] = None,
25+
timeout: Union[float, Tuple[float, float], Tuple[float, None], None] = None,
2626
verify: Union[bool, str] = True,
27-
cert: Union[bytes, str, tuple[Union[bytes, str], Union[bytes, str]], None] = None,
27+
cert: Union[bytes, str, Tuple[Union[bytes, str], Union[bytes, str]], None] = None,
2828
proxies: Optional[Mapping[str, str]] = None,
2929
) -> Response:
3030
timeout = timeout or self.timeout

tests/utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
but are used across multiple test files.
66
"""
77

8+
from __future__ import annotations
9+
810
import os
911
import subprocess
10-
from typing import Any, Dict
12+
from typing import Any
1113

1214

1315
def run_in_venv(
14-
venv_info: Dict[str, Any], cmd: str, check: bool = True, **kwargs: Any
16+
venv_info: dict[str, Any], cmd: str, check: bool = True, **kwargs: Any
1517
) -> subprocess.CompletedProcess[str]:
1618
"""
1719
Run a command in an isolated virtual environment.

0 commit comments

Comments
 (0)