Skip to content

Commit

Permalink
Merge pull request #226 from Rotzbua/chore_pre-commit
Browse files Browse the repository at this point in the history
feat: add `pyupgrade` to `pre-commit`
  • Loading branch information
wRAR authored May 28, 2024
2 parents 5ef63e6 + 56163a6 commit 78cbd42
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9']
python-version: ['3.12']
tox-job: ["linters"]

steps:
Expand Down
14 changes: 8 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions extruct/w3cmicrodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,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 (
Expand Down Expand Up @@ -132,7 +132,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:
Expand Down

0 comments on commit 78cbd42

Please sign in to comment.