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

[pre-commit.ci] pre-commit autoupdate #105

Open
wants to merge 2 commits into
base: main
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ ci:
skip: [pip-compile]
repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.13.2
hooks:
- id: isort
name: isort
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.14.0
hooks:
- id: mypy
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/jazzband/pip-tools
rev: 6.10.0
rev: 7.4.1
hooks:
- id: pip-compile
files: ^(pyproject\.toml|requirements\.txt)$
Expand Down
1 change: 1 addition & 0 deletions code_data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Transform Python code objects into data, and vice versa.
"""

from __future__ import annotations

from collections import OrderedDict
Expand Down
1 change: 1 addition & 0 deletions code_data/_flags_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
We represent code flags as a set of literal strings, representing each
compiler flag.
"""

from __future__ import annotations

import dis
Expand Down
14 changes: 8 additions & 6 deletions code_data/_line_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ def collapse_items(items: ExpandedItems, is_linetable: bool) -> CollapsedItems:
"""
collapsed_items = [
CollapsedLineTableItem(
line_offset=None
if is_linetable and i.line_offset == -128
else i.line_offset,
line_offset=(
None if is_linetable and i.line_offset == -128 else i.line_offset
),
bytecode_offset=i.bytecode_offset,
)
for i in items
Expand Down Expand Up @@ -245,9 +245,11 @@ def expand_bytecode():
while bytecode_offset > MAX_BYTECODE:
expanded_items.append(
LineTableItem(
line_offset=(-128 if line_offset is None else line_offset)
if is_linetable
else 0,
line_offset=(
(-128 if line_offset is None else line_offset)
if is_linetable
else 0
),
bytecode_offset=MAX_BYTECODE,
)
)
Expand Down
8 changes: 5 additions & 3 deletions code_data/_test_verify_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ def code_to_primitives(code: CodeType) -> dict[str, object]:
for a in code.co_consts
)
if name == "co_consts"
else [(i.opname, i.argval) for i in _get_instructions_bytes(code.co_code)]
if name == "co_code"
else getattr(code, name)
else (
[(i.opname, i.argval) for i in _get_instructions_bytes(code.co_code)]
if name == "co_code"
else getattr(code, name)
)
)
for name in code_attributes
}
Expand Down
Loading