Skip to content

Commit

Permalink
fix: mypy complaints about graphlib-backport (closes #35)
Browse files Browse the repository at this point in the history
  • Loading branch information
metaist committed Jul 25, 2024
1 parent b1bb763 commit 02c892a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ requires-python = ">=3.8"
dependencies = [
# app => version pinned exactly

# TODO 2026-10-04 [3.10 EOL]: remove
"tomli==2.0.1; python_version < '3.11'",

# TODO 2024-10-31 [3.8 EOL]: remove
"graphlib_backport==1.1.0; python_version < '3.9'",

# TODO 2026-10-04 [3.10 EOL]: remove
"tomli==2.0.1; python_version < '3.11'",
]
optional-dependencies = { dev = [
# dev => version latest
Expand Down
7 changes: 6 additions & 1 deletion src/ds.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,19 @@
from typing import List
from typing import Mapping
from typing import Optional
import graphlib # type: ignore
import json
import os
import re
import shlex
import sys
import textwrap

# TODO 2024-10-31 [3.8 EOL]: remove conditional
if sys.version_info >= (3, 9): # pragma: no cover
import graphlib
else: # pragma: no cover
import graphlib # type: ignore


# TODO 2026-10-04 [3.10 EOL]: remove conditional
if sys.version_info >= (3, 11): # pragma: no cover
Expand Down
9 changes: 8 additions & 1 deletion test/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# std
from pathlib import Path
from graphlib import CycleError # type: ignore
import sys

# lib
import pytest
Expand All @@ -15,6 +15,13 @@
from ds import Task


# TODO 2024-10-31 [3.8 EOL]: remove conditional
if sys.version_info >= (3, 9): # pragma: no cover
from graphlib import CycleError
else: # pragma: no cover
from graphlib import CycleError # type: ignore


def test_skipped() -> None:
"""Parse configs that are skipped."""
# tasks that start with a hash (#) are disabled
Expand Down

0 comments on commit 02c892a

Please sign in to comment.