Skip to content

Commit

Permalink
Version 3.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mborsetti committed Jun 9, 2022
1 parent 99d0252 commit 304f25a
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 3.10.2rc5
current_version = 3.10.2
message = Release {new_version}
parse = ^
(?P<major>\d+)
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ can check out the `wish list <https://github.com/mborsetti/webchanges/blob/main/
Internals, for changes that don't affect users. [triggers a minor patch]
Version 3.10.2rc5
Version 3.10.2
===================
Unreleased
2022-06-22

⚠ Breaking Changes
------------------
Expand Down Expand Up @@ -95,7 +95,7 @@ Internals

Version 3.10.1
===================
20220503
2022-05-03

Fixed
-----
Expand Down
2 changes: 1 addition & 1 deletion webchanges/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# * MINOR version when you add functionality in a backwards compatible manner, and
# * MICRO or PATCH version when you make backwards compatible bug fixes. We no longer use '0'
# If unsure on increments, use pkg_resources.parse_version to parse
__version__ = '3.10.2rc5'
__version__ = '3.10.2'
__description__ = (
'Check web (or commands) for changes since last run and notify.\n\nAnonymously alerts you of webpage changes.'
)
Expand Down
2 changes: 1 addition & 1 deletion webchanges/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


@dataclass
class BaseConfig(object):
class BaseConfig:
"""Base configuration class."""

project_name: str
Expand Down
6 changes: 3 additions & 3 deletions webchanges/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from abc import ABC
from enum import Enum
from html.parser import HTMLParser
from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Type, TYPE_CHECKING, Union
from typing import Any, Dict, Iterator, List, Optional, Tuple, Type, TYPE_CHECKING, Union
from xml.dom import minidom # nosec: B408 Replace minidom with the equivalent defusedxml package TODO

import html2text
Expand Down Expand Up @@ -82,7 +82,7 @@
logger = logging.getLogger(__name__)


class FilterBase(object, metaclass=TrackSubClasses):
class FilterBase(metaclass=TrackSubClasses):
"""The base class for filters."""

__subclasses__: Dict[str, Type[FilterBase]] = {}
Expand Down Expand Up @@ -1403,7 +1403,7 @@ def filter(self, data: str, subfilter: Dict[str, Any]) -> str: # type: ignore[o
separator = subfilter.get('separator', '\n')
data_lines = data.split(separator)

def get_unique_lines(lines: List[str]) -> Iterable[str]:
def get_unique_lines(lines: List[str]) -> Iterator[str]:
seen = set()
for line in lines:
if line not in seen:
Expand Down
6 changes: 3 additions & 3 deletions webchanges/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from datetime import datetime
from pathlib import Path
from types import TracebackType
from typing import Any, ContextManager, Dict, Iterable, List, Optional, Type, TYPE_CHECKING, Union
from typing import Any, ContextManager, Dict, Iterator, List, Optional, Type, TYPE_CHECKING, Union

from .filters import FilterBase
from .jobs import NotModifiedError
Expand Down Expand Up @@ -478,7 +478,7 @@ def _pretty_print_diff(diff: DiffLevel) -> str:
return '\n'.join(diff)


class Report(object):
class Report:
"""The base class for reporting."""

job_states: List[JobState] = []
Expand Down Expand Up @@ -552,7 +552,7 @@ def custom(self, job_state: JobState, label: str) -> None:
"""
self._result(label, job_state)

def get_filtered_job_states(self, job_states: List[JobState]) -> Iterable[JobState]:
def get_filtered_job_states(self, job_states: List[JobState]) -> Iterator[JobState]:
"""Returns JobStates that have reportable changes per config['display']. Called from :py:Class:`ReporterBase`.
:param job_states: The list of JobState objects with the information of the job runs.
Expand Down
2 changes: 1 addition & 1 deletion webchanges/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __str__(self) -> str:
return self.args[0]


class JobBase(object, metaclass=TrackSubClasses):
class JobBase(metaclass=TrackSubClasses):
"""The base class for Jobs."""

__subclasses__: Dict[str, 'JobBase'] = {}
Expand Down
2 changes: 1 addition & 1 deletion webchanges/mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
logger = logging.getLogger(__name__)


class Mailer(object):
class Mailer:
"""Mailer class."""

def send(self, msg: Union[EmailMessage]) -> None:
Expand Down
2 changes: 1 addition & 1 deletion webchanges/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
logger = logging.getLogger(__name__)


class Urlwatch(object):
class Urlwatch:
"""The main class."""

def __init__(
Expand Down
18 changes: 9 additions & 9 deletions webchanges/reporters.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import time
from datetime import datetime
from pathlib import Path
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, TYPE_CHECKING, Union
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, TYPE_CHECKING, Union
from warnings import warn

import requests
Expand Down Expand Up @@ -112,7 +112,7 @@
logger = logging.getLogger(__name__)


class ReporterBase(object, metaclass=TrackSubClasses):
class ReporterBase(metaclass=TrackSubClasses):
"""Base class for reporting."""

__subclasses__: Dict[str, Type[ReporterBase]] = {}
Expand Down Expand Up @@ -222,7 +222,7 @@ def submit_all(
if not any_enabled:
logger.warning('No reporters enabled.')

def submit(self, **kwargs: Any) -> Iterable[str]:
def submit(self, **kwargs: Any) -> Iterator[str]:
"""Submit a job to generate the report.
:returns: The content of the report.
Expand All @@ -233,14 +233,14 @@ def submit(self, **kwargs: Any) -> Iterable[str]:
class HtmlReporter(ReporterBase):
"""The base class for all reports using HTML."""

def submit(self, **kwargs: Any) -> Iterable[str]:
def submit(self, **kwargs: Any) -> Iterator[str]:
"""Submit a job to generate the report.
:returns: The content of the HTML report.
"""
yield from self._parts()

def _parts(self) -> Iterable[str]:
def _parts(self) -> Iterator[str]:
"""Generator yielding the HTML; called by submit. Calls _format_content.
:returns: The content of the report.
Expand Down Expand Up @@ -304,7 +304,7 @@ def _parts(self) -> Iterable[str]:
yield '</div>\n</body>\n</html>\n'

@staticmethod
def _diff_to_html(diff: str, job: JobBase) -> Iterable[str]:
def _diff_to_html(diff: str, job: JobBase) -> Iterator[str]:
"""Generator yielding the HTML-formatted unified diff; called by _format_content.
:param diff: The diff text.
Expand Down Expand Up @@ -542,7 +542,7 @@ def _format_content(
class TextReporter(ReporterBase):
"""The base class for all reports using plain text."""

def submit(self, **kwargs: Any) -> Iterable[str]:
def submit(self, **kwargs: Any) -> Iterator[str]:
"""Submit a job to generate the report.
:returns: The content of the plain text report.
Expand Down Expand Up @@ -653,7 +653,7 @@ def _format_output(self, job_state: JobState, line_length: int, tz: Optional[str
class MarkdownReporter(ReporterBase):
"""The base class for all reports using Markdown."""

def submit(self, max_length: Optional[int] = None, **kwargs: Any) -> Iterable[str]:
def submit(self, max_length: Optional[int] = None, **kwargs: Any) -> Iterator[str]:
"""Submit a job to generate the report in Markdown format.
We use the CommonMark spec: https://spec.commonmark.org/
Expand Down Expand Up @@ -1572,7 +1572,7 @@ def submit(self) -> None: # type: ignore[override]
os.remove(f.name)


class XMPP(object):
class XMPP:
def __init__(self, sender: str, recipient: str, insecure_password: Optional[str] = None) -> None:
if aioxmpp is None:
raise ImportError('Python package "aioxmpp" is not installed; cannot use the "xmpp" reporter')
Expand Down
4 changes: 2 additions & 2 deletions webchanges/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from os import PathLike
from pathlib import Path
from types import ModuleType
from typing import Callable, Dict, Iterable, List, Match, Optional, Tuple, Union
from typing import Callable, Dict, List, Match, Optional, Tuple, Union

import requests

Expand Down Expand Up @@ -127,7 +127,7 @@ def import_module_from_source(module_name: str, source_path: Union[str, bytes, P
return module


def chunk_string(text: str, length: int, numbering: bool = False) -> Iterable[str]:
def chunk_string(text: str, length: int, numbering: bool = False) -> List[str]:
"""Chunks a string.
:param text: The text to be chunked.
Expand Down

0 comments on commit 304f25a

Please sign in to comment.