Skip to content

Commit

Permalink
Test Python 3.13 (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
JelleZijlstra authored Oct 15, 2024
1 parent 6245c10 commit a72e03d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
- name: py312
python: "3.12"
toxenv: py312
- name: py313
python: "3.13"
toxenv: py313
- name: black
python: "3.12"
toxenv: black
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Add support for Python 3.13 (#824)
- Drop support for Python 3.8 (#820)
- Flag invalid regexes in arguments to functions like
`re.search` (#816)
Expand Down
4 changes: 2 additions & 2 deletions pyanalyze/name_check_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4816,8 +4816,8 @@ def visit_TypeVar(self, node: ast.TypeVar) -> Value:
else:
bound = self.visit(node.bound)
if sys.version_info >= (3, 13):
if node.default is not None:
default = self.visit(node.default)
if node.default_value is not None:
default = self.visit(node.default_value)
tv = TypeVar(node.name)
typevar = TypeVarValue(
tv,
Expand Down
11 changes: 10 additions & 1 deletion pyanalyze/test_arg_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,19 @@ def test_get_argspec():
Composite(KnownValue(ClassWithCall)),
) == asc.get_argspec(ClassWithCall.pure_async_classmethod)

# This behaves differently in 3.9 through 3.12 than in earlier and later
# versions. The behavior change was made in
# https://github.com/python/cpython/issues/63272
# and undone in https://github.com/python/cpython/issues/89519
if hasattr(ClassWithCall.classmethod_before_async, "decorator"):
callable = ClassWithCall.classmethod_before_async.decorator.fn
else:
callable = ClassWithCall.classmethod_before_async.__func__.fn

assert BoundMethodSignature(
Signature.make(
[SigParameter("cls"), SigParameter("ac")],
callable=ClassWithCall.classmethod_before_async.decorator.fn,
callable=callable,
is_asynq=True,
),
Composite(KnownValue(ClassWithCall)),
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
],
keywords="quora static analysis",
packages=["pyanalyze"],
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ commands =

[testenv:ruff]
deps =
ruff==0.2.2
ruff==0.6.9

commands =
ruff check pyanalyze/

0 comments on commit a72e03d

Please sign in to comment.