Skip to content
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
3 changes: 2 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v3
Expand All @@ -19,6 +19,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools
pip install -r requirements.txt
- name: Test with pytest
run: |
Expand Down
19 changes: 7 additions & 12 deletions ast_scope/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,10 @@ def compute_class_fields(class_node):
:returns: (class_fields, parent_fields)
two lists containing the fields in the class scope and the parent scope, respectively.
"""
assert class_node._fields == (
"name",
"bases",
"keywords",
"body",
"decorator_list",
)
return [class_node.body], [
class_node.bases,
class_node.keywords,
class_node.decorator_list,
]
fields_in_all = ("name", "bases", "keywords", "body", "decorator_list")
assert class_node._fields in (fields_in_all, fields_in_all + ("type_params",))
class_fields = [class_node.body]
parent_fields = [class_node.bases, class_node.keywords, class_node.decorator_list]
if "type_params" in class_node._fields:
class_fields.append(class_node.type_params)
return class_fields, parent_fields
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="ast_scope", # Replace with your own username
version="0.4.6",
version="0.5.0",
author="Kavi Gupta",
author_email="ast_scope@kavigupta.org",
description="Annotates a Python AST with the scope of symbols.",
Expand All @@ -17,6 +17,8 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
],
python_requires=">=3.9",
Expand Down