diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 416ed70..809648f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] runs-on: ${{ matrix.os }} diff --git a/README.md b/README.md index 7df1a72..50015fb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # python devtools -[![CI](https://github.com/samuelcolvin/python-devtools/workflows/CI/badge.svg?event=push)](https://github.com/samuelcolvin/python-devtools/actions?query=event%3Apush+branch%3Amain+workflow%3ACI) +[![CI](https://img.shields.io/github/actions/workflow/status/samuelcolvin/python-devtools/ci.yml?branch=main&logo=github&label=CI)](https://github.com/samuelcolvin/python-devtools/actions?query=event%3Apush+branch%3Amain+workflow%3ACI) [![Coverage](https://coverage-badge.samuelcolvin.workers.dev/samuelcolvin/python-devtools.svg)](https://coverage-badge.samuelcolvin.workers.dev/redirect/samuelcolvin/python-devtools) [![pypi](https://img.shields.io/pypi/v/devtools.svg)](https://pypi.python.org/pypi/devtools) [![versions](https://img.shields.io/pypi/pyversions/devtools.svg)](https://github.com/samuelcolvin/python-devtools) diff --git a/docs/index.md b/docs/index.md index 2a3bd48..c1f2a3b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # Python devtools -[![CI](https://github.com/samuelcolvin/python-devtools/workflows/CI/badge.svg?event=push)](https://github.com/samuelcolvin/python-devtools/actions?query=event%3Apush+branch%3Amain+workflow%3ACI) +[![CI](https://img.shields.io/github/actions/workflow/status/samuelcolvin/python-devtools/ci.yml?branch=main&logo=github&label=CI)](https://github.com/samuelcolvin/python-devtools/actions?query=event%3Apush+branch%3Amain+workflow%3ACI) [![Coverage](https://coverage-badge.samuelcolvin.workers.dev/samuelcolvin/python-devtools.svg)](https://coverage-badge.samuelcolvin.workers.dev/redirect/samuelcolvin/python-devtools) [![pypi](https://img.shields.io/pypi/v/devtools.svg)](https://pypi.python.org/pypi/devtools) [![versions](https://img.shields.io/pypi/pyversions/devtools.svg)](https://github.com/samuelcolvin/python-devtools) diff --git a/pyproject.toml b/pyproject.toml index 28c6b5b..30891c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ classifiers = [ 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: 3.14', + 'Programming Language :: Python :: 3.15', 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Internet', 'Typing :: Typed', diff --git a/tests/test_prettier.py b/tests/test_prettier.py index 4a3c4ea..3f9b3c8 100644 --- a/tests/test_prettier.py +++ b/tests/test_prettier.py @@ -1,7 +1,6 @@ import ast import os import string -import sys from collections import Counter, OrderedDict from collections.abc import Iterator from dataclasses import dataclass @@ -456,40 +455,14 @@ class User(SQLAlchemyBase): ) -@pytest.mark.skipif(sys.version_info < (3, 9), reason='no indent on older versions') def test_ast_expr(): - if sys.version_info >= (3, 13): - # ast.dump omits empty lists from 3.13 onwards - expected = ( - 'Expression(' - '\n body=Call(' - "\n func=Name(id='print', ctx=Load())," - '\n args=[' - '\n Constant(value=1),' - '\n Constant(value=2),' - '\n Call(' - "\n func=Name(id='round', ctx=Load())," - '\n args=[' - '\n Constant(value=3)])]))' - ) - else: - expected = ( - 'Expression(' - '\n body=Call(' - "\n func=Name(id='print', ctx=Load())," - '\n args=[' - '\n Constant(value=1),' - '\n Constant(value=2),' - '\n Call(' - "\n func=Name(id='round', ctx=Load())," - '\n args=[' - '\n Constant(value=3)],' - '\n keywords=[])],' - '\n keywords=[]))' - ) - assert pformat(ast.parse('print(1, 2, round(3))', mode='eval')) == expected - - -@pytest.mark.skipif(sys.version_info < (3, 9), reason='no indent on older versions') + node = ast.parse('print(1, 2, round(3))', mode='eval') + v = pformat(node) + # exactly which fields ast.dump omits changes between python versions, so compare to its own output + assert v == ast.dump(node, indent=4) + assert v.startswith('Expression(\n body=Call(\n func=Name(') + assert '\n Constant(value=3)' in v + + def test_ast_module(): assert pformat(ast.parse('print(1, 2, round(3))')).startswith('Module(\n body=[')