Skip to content
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
26 changes: 13 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["2.7", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
include:
- os: ubuntu-latest
- os: ubuntu-18.04
flake: ==3.8
python-version: 3.4
- flake: ==3.9
python-version: 2.7
- os: ubuntu-22.04
flake: ==6.1
python-version: 3.9
- flake: ==7.3
os: ubuntu-latest
python-version: 3.14

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8${{ matrix.flake }} six
python setup.py develop
python -m pip install --upgrade pip setuptools
pip install -e . flake8${{ matrix.flake }} six
- name: Run tests
run: python -m unittest -v
run: python -m unittest -v
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

17 changes: 13 additions & 4 deletions flake8_string_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,19 @@ def _add_node(self, node):
self.nodes += [node]

def is_base_string(self, node):
typ = (ast.Str,)
if sys.version_info[0] > 2:
typ += (ast.Bytes,)
return isinstance(node, typ)
# Python 3.14 removed ast.Str/ast.Bytes, but older versions still use
# or expose them, so accept modern Constant nodes first and then fall
# back to whichever legacy node types still exist on this interpreter.
if isinstance(node, ast.Constant):
return isinstance(node.value, (str, bytes))

types = []
if hasattr(ast, 'Str'):
types.append(ast.Str)
if sys.version_info[0] > 2 and hasattr(ast, 'Bytes'):
types.append(ast.Bytes)

return isinstance(node, tuple(types))

def visit_Str(self, node):
# Constant with Python 3.8 uses the value-property
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def get_long_description():
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Quality Assurance',
Expand Down