Skip to content

Loosen version restrictions #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/dist
/build
__pycache__/
.coverage
/build
/dist
poetry.lock

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
repos:

- repo: https://github.com/pycqa/isort
rev: 5.9.3
rev: 5.13.2
hooks:
- id: isort
additional_dependencies: [toml]
- repo: https://github.com/psf/black
rev: 21.7b0
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
rev: v0.942
hooks:
- id: mypy
- repo: https://github.com/pycqa/pylint
rev: v2.9.5
rev: v2.17.7
hooks:
- id: pylint
additional_dependencies: [toml]
2 changes: 1 addition & 1 deletion ass_parser/ass_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def __eq__(self, other: Any) -> bool:
key.startswith("_")
or key == "parent"
or getattr(self, key) == getattr(other, key)
for key in self.__dataclass_fields__ # type: ignore
for key in self.__dataclass_fields__
)


Expand Down
2 changes: 2 additions & 0 deletions ass_parser/ass_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""AssFile definition."""
from __future__ import annotations

from dataclasses import dataclass
from typing import IO, Any

Expand Down
2 changes: 2 additions & 0 deletions ass_parser/ass_sections/ass_base_section.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""AssBaseSection definition."""
from __future__ import annotations

from collections.abc import Iterable
from typing import TypeVar

Expand Down
2 changes: 2 additions & 0 deletions ass_parser/ass_sections/ass_base_tabular_section.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""AssBaseTabularSection definition."""
from __future__ import annotations

from collections.abc import Iterable, MutableSequence
from typing import Generic, TypeVar

Expand Down
2 changes: 2 additions & 0 deletions ass_parser/ass_sections/ass_event_list.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""AssEventList definition."""
from __future__ import annotations

import re
from typing import Any, Optional

Expand Down
6 changes: 4 additions & 2 deletions ass_parser/ass_sections/ass_key_value_mapping.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""AssKeyValueMapping definition."""
from __future__ import annotations

from collections.abc import Iterable
from typing import Any

Expand All @@ -25,8 +27,8 @@ def consume_ass_body_lines(self, lines: list[tuple[int, str]]) -> None:
raise CorruptAssLineError(
line_num, line, "expected a colon"
) from exc
else:
self[key] = value.lstrip()

self[key] = value.lstrip()

def produce_ass_body_lines(self) -> Iterable[str]:
"""Produce ASS text representation of self, excluding the ASS header
Expand Down
7 changes: 6 additions & 1 deletion ass_parser/ass_sections/ass_string_table.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
"""AssStringTable definition."""

from __future__ import annotations

from typing import Dict, Tuple

from ass_parser.ass_sections.ass_base_tabular_section import (
AssBaseTabularSection,
)
from ass_parser.observable_sequence_mixin import ObservableSequenceMixin

AssStringTableItem = tuple[str, dict[str, str]]
AssStringTableItem = Tuple[str, Dict[str, str]]


class AssStringTable(
Expand Down
2 changes: 2 additions & 0 deletions ass_parser/ass_sections/ass_style_list.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""AssStyleList definition."""
from __future__ import annotations

from typing import Any, Optional

from ass_parser.ass_color import AssColor
Expand Down
2 changes: 1 addition & 1 deletion ass_parser/ass_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,5 +126,5 @@ def __eq__(self, other: Any) -> bool:
key.startswith("_")
or key == "parent"
or getattr(self, key) == getattr(other, key)
for key in self.__dataclass_fields__ # type: ignore
for key in self.__dataclass_fields__
)
2 changes: 2 additions & 0 deletions ass_parser/observable.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Observable containers and objects."""
from __future__ import annotations

from dataclasses import dataclass, field
from typing import Any, Callable, Generic, Optional, Type, TypeVar, cast

Expand Down
6 changes: 4 additions & 2 deletions ass_parser/observable_mapping_mixin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""ObservableMappingMixin definition."""
from __future__ import annotations

from collections.abc import Iterable, Iterator, Mapping, MutableMapping
from dataclasses import dataclass
from typing import Any, TypeVar, Union, cast, overload
Expand All @@ -23,7 +25,7 @@ class ObservableMappingMixin(MutableMapping[TKey, TValue]):

def __init__(self, *args: Any, **kwargs: Any) -> None:
"""Initialize self."""
super().__init__(*args, **kwargs) # type: ignore
super().__init__(*args, **kwargs)
self._data: dict[TKey, TValue] = {}

def __getitem__(self, key: TKey) -> TValue:
Expand Down Expand Up @@ -73,7 +75,7 @@ def clear(self) -> None:
self._data.clear()
self.changed.emit(ObservableMappingChangeEvent())

@overload
@overload # type: ignore
def update(
self, other: Mapping[TKey, TValue], /, **kwargs: TValue
) -> None:
Expand Down
4 changes: 3 additions & 1 deletion ass_parser/observable_sequence_mixin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""ObservableSequenceMixin definition."""
from __future__ import annotations

from collections.abc import Iterable, MutableSequence
from dataclasses import dataclass
from typing import Any, Generic, TypeVar, Union, overload
Expand Down Expand Up @@ -71,7 +73,7 @@ class ObservableSequenceMixin(MutableSequence[TItem]):

def __init__(self, *args: Any, **kwargs: Any) -> None:
"""Initialize self."""
super().__init__(*args, **kwargs) # type: ignore
super().__init__(*args, **kwargs)
self._data: list[TItem] = []

def __len__(self) -> int:
Expand Down
2 changes: 2 additions & 0 deletions ass_parser/tests/test_ass_color.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Tests for the AssColor class."""
from __future__ import annotations

from typing import Union

import pytest
Expand Down
2 changes: 2 additions & 0 deletions ass_parser/tests/test_observable_object_mixin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Tests for the ObservableObjectMixin class."""
from __future__ import annotations

from dataclasses import dataclass
from typing import Type
from unittest.mock import Mock
Expand Down
2 changes: 1 addition & 1 deletion ass_parser/tests/test_observable_sequence_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_basic_delete() -> None:
seq = DummySequence()
seq.append(123)
del seq[0]
assert list(seq) == []
assert not list(seq)


def test_basic_delete_emits_removal_event() -> None:
Expand Down
2 changes: 2 additions & 0 deletions ass_parser/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Various ASS utilities."""
from __future__ import annotations

import re
from decimal import Decimal
from typing import Union
Expand Down
Loading