Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing fixes #965

Merged
merged 2 commits into from
Jan 18, 2024
Merged
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
8 changes: 2 additions & 6 deletions pontos/version/commands/_cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


import re
from typing import Generator, Literal, Optional, Tuple, Union
from typing import Iterator, Literal, Optional, Tuple, Union

from .._errors import VersionError
from .._version import Version, VersionUpdate
Expand Down Expand Up @@ -189,11 +189,7 @@ def is_dev_version(self) -> bool:

def _tokenize( # type: ignore
self, content: str
) -> Generator[
Tuple[int, str, str],
Tuple[int, str, str],
Tuple[int, str, str],
]:
) -> Iterator[Tuple[int, str, str]]:
toks, remainder = self.__cmake_scanner.scan(content)
if remainder != "":
print(f"WARNING: unrecognized cmake tokens: {remainder}")
Expand Down
6 changes: 4 additions & 2 deletions pontos/version/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#


from typing import List, Literal, Union
from typing import List, Literal, Type, Union

from ._errors import ProjectError
from ._version import Version, VersionUpdate
Expand All @@ -27,7 +27,9 @@ class Project:
project = Project(PEP440VersioningScheme)
"""

def __init__(self, versioning_scheme: VersioningScheme) -> None:
def __init__(
self, versioning_scheme: Union[VersioningScheme, Type[VersioningScheme]]
) -> None:
"""
Creates a new project instance

Expand Down