mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
turn mypy checks back on, fix some errors
This commit is contained in:
@ -5,10 +5,13 @@ import subprocess
|
||||
from tempfile import (
|
||||
TemporaryDirectory,
|
||||
)
|
||||
from typing import (
|
||||
Tuple,
|
||||
)
|
||||
import venv
|
||||
|
||||
|
||||
def create_venv(parent_path):
|
||||
def create_venv(parent_path: Path) -> Path:
|
||||
venv_path = parent_path / "package-smoke-test"
|
||||
venv.create(venv_path, with_pip=True)
|
||||
subprocess.run(
|
||||
@ -17,7 +20,7 @@ def create_venv(parent_path):
|
||||
return venv_path
|
||||
|
||||
|
||||
def find_wheel(project_path):
|
||||
def find_wheel(project_path: Path) -> Path:
|
||||
wheels = list(project_path.glob("dist/*.whl"))
|
||||
|
||||
if len(wheels) != 1:
|
||||
@ -29,7 +32,9 @@ def find_wheel(project_path):
|
||||
return wheels[0]
|
||||
|
||||
|
||||
def install_wheel(venv_path, wheel_path, extras=()):
|
||||
def install_wheel(
|
||||
venv_path: Path, wheel_path: Path, extras: Tuple[str, ...] = ()
|
||||
) -> None:
|
||||
if extras:
|
||||
extra_suffix = f"[{','.join(extras)}]"
|
||||
else:
|
||||
@ -41,7 +46,7 @@ def install_wheel(venv_path, wheel_path, extras=()):
|
||||
)
|
||||
|
||||
|
||||
def test_install_local_wheel():
|
||||
def test_install_local_wheel() -> None:
|
||||
with TemporaryDirectory() as tmpdir:
|
||||
venv_path = create_venv(Path(tmpdir))
|
||||
wheel_path = find_wheel(Path("."))
|
||||
|
||||
Reference in New Issue
Block a user