diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 44d2110c..6415d00e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.9'] + python-version: ['3.12'] tox-job: ["linters"] steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bdcb7ee9..fad55f9a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,18 @@ repos: - hooks: - id: black - language_version: python3 - repo: https://github.com/ambv/black - rev: 22.10.0 + repo: https://github.com/psf/black-pre-commit-mirror + rev: 24.4.0 - hooks: - id: isort - language_version: python3 repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 - hooks: - id: mypy additional_dependencies: [types-requests, types-mock, lxml-stubs] repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.982 + rev: v1.9.0 + - hooks: + - id: pyupgrade + repo: https://github.com/asottile/pyupgrade + rev: v3.15.2 diff --git a/extruct/w3cmicrodata.py b/extruct/w3cmicrodata.py index 97647271..9336d6a1 100644 --- a/extruct/w3cmicrodata.py +++ b/extruct/w3cmicrodata.py @@ -74,7 +74,7 @@ def extract(self, htmlstring, base_url=None, encoding="UTF-8"): def extract_items(self, document, base_url): itemids = self._build_itemids(document) - items_seen: Set[Any] = set() + items_seen: set[Any] = set() return [ item for item in ( @@ -136,7 +136,7 @@ def _extract_item(self, node, items_seen, base_url, itemids): properties[name].append(value) props = [] - for (name, values) in properties.items(): + for name, values in properties.items(): if not self.strict and len(values) == 1: props.append((name, values[0])) else: