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

feat: add pyupgrade to pre-commit #226

Merged
merged 4 commits into from
May 28, 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
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

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 @@ -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()
lopuhin marked this conversation as resolved.
Show resolved Hide resolved
return [
item
for item in (
Expand Down Expand Up @@ -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:
Expand Down
Loading