Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- { short: linux, name: ubuntu-latest }
- { short: win, name: windows-latest }
- { short: macos, name: macos-14 }
python-version: ["3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "README.md"
license = "BSD-3-Clause AND PSF-2.0"
license-files = ["LICENSE.txt"]

requires-python = ">=3.12"
requires-python = ">=3.10"
keywords = ["typing", "stub files", "docstings", "numpydoc"]
classifiers = [
"Development Status :: 3 - Alpha",
Expand All @@ -25,6 +25,8 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Code Generators",
Expand All @@ -38,6 +40,7 @@ dependencies = [
"lark >=1.1.9",
"black >=24.4.2",
"isort >=5.13.2",
"typing_extensions >= 4.5.0"
]

[project.optional-dependencies]
Expand Down
7 changes: 4 additions & 3 deletions src/docstub/_cache.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import logging
from functools import cached_property
from typing import Any, Protocol

logger = logging.getLogger(__name__)
from typing_extensions import Any, Protocol, TypeVar

logger = logging.getLogger(__name__)

T = TypeVar("T")
CACHE_DIR_NAME = ".docstub_cache"


Expand Down Expand Up @@ -92,7 +93,7 @@ def validate_cache(path):
raise FileNotFoundError(f"expected '{path}' to contain a '.gitignore' file")


class FuncSerializer[T](Protocol):
class FuncSerializer(Protocol[T]):
"""Defines an interface to serialize and deserialize results of a function.

This interface is used by `FileCache` to cache results of a
Expand Down
2 changes: 1 addition & 1 deletion tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_command_line_reference(command, name):
with md_file.open("r") as io:
md_content = io.read()

guard_name = f"cli-{name.replace(" ", "-")}"
guard_name = f"cli-{name.replace(' ', '-')}"
regex = rf"<!--- begin {guard_name} --->(.*)<!--- end {guard_name} --->"
matches = re.findall(regex, md_content, flags=re.DOTALL)
assert len(matches) == 1
Expand Down