Skip to content

Commit

Permalink
Merge pull request #1 from neptune-ai/rj/py-3.12
Browse files Browse the repository at this point in the history
Support for Python 3.12
  • Loading branch information
Raalsky authored Mar 14, 2024
2 parents 16b9dd4 + 3bcc74e commit 68469a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
name: Python ${{ matrix.python-version }} testing
steps:
- uses: actions/checkout@v3
Expand Down
13 changes: 10 additions & 3 deletions pflake8/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,20 @@ class DivertingConfigParser(ConfigParserTomlMixin, configparser.ConfigParser):
pass


class DivertingSafeConfigParser(ConfigParserTomlMixin, configparser.SafeConfigParser):
pass
try:

class DivertingSafeConfigParser(
ConfigParserTomlMixin, configparser.SafeConfigParser
):
pass

configparser.SafeConfigParser = DivertingSafeConfigParser
except AttributeError:
pass # does not exist on Python 3.12 (https://github.com/python/cpython/issues/89336#issuecomment-1094366625)


configparser.RawConfigParser = DivertingRawConfigParser
configparser.ConfigParser = DivertingConfigParser
configparser.SafeConfigParser = DivertingSafeConfigParser


class FixFilenames(ast.NodeTransformer):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ classifiers = []
requires-python = ">=3.8.1"
dependencies = [
"tomli; python_version < '3.11'",
"flake8 == 6.1.0"
"flake8 == 7.0.0"
]

[project.urls]
Expand Down

0 comments on commit 68469a4

Please sign in to comment.