Skip to content

Commit

Permalink
Support Python 3.12 (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-burst committed Apr 1, 2024
1 parent b0dfda3 commit 705c2ad
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 65 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- 3.9
- "3.10"
- 3.11
- 3.12

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ MIT

**Unreleased**

* require at least Python 3.8.0
* require at least Python 3.8.1
* support Python 3.12

**1.7.2 - 2023-02-15**

Expand Down
94 changes: 39 additions & 55 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
PT = 'flake8_pytest_style.plugin:PytestStylePlugin'

[tool.poetry.dependencies]
python = "^3.8.0"
python = "^3.8.1"
flake8-plugin-utils = "^1.3.2"

[tool.poetry.group.dev.dependencies]
Expand All @@ -37,7 +37,7 @@ pylint = "^3.1.0"
pytest = "^8.1.1"
pytest-cov = "5.0.0"
pytest-deadfixtures = "^2.1"
flake8 = "^4.0.1"
flake8 = "^7.0.0"
pytest-mock = "^3.11.1"
unify = "^0.5.0"
tomlkit = "^0.12.1"
Expand Down
8 changes: 5 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[flake8]
enable-extensions = G
exclude = .git, .venv
ignore =
A003 ; 'id' is a python builtin, consider renaming the class attribute
W503 ; line break before binary operator
extend-ignore =
; 'id' is a python builtin, consider renaming the class attribute
A003,
; line break before binary operator
W503,
max-complexity = 10
max-line-length = 88
per-file-ignores =
Expand Down
2 changes: 1 addition & 1 deletion tests/test_PT027_unittest_raises_assertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ def test_xxx():
UnittestAssertionVisitor,
code,
UnittestRaisesAssertion,
assertion="assertRaises",
assertion='assertRaises',
)
17 changes: 14 additions & 3 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,25 @@

@pytest.fixture()
def option_manager() -> OptionManager:
manager = OptionManager(prog='flake8', version=flake8.__version__)
manager = OptionManager(
version=flake8.__version__,
plugin_versions='', # Not necessary in tests
parents=[],
formatter_names=[],
)
PytestStylePlugin.add_options(option_manager=manager)
return manager


def parse_options(manager: OptionManager, args: List[str]) -> Config:
namespace, remaining_args = manager.parse_args(args)
return PytestStylePlugin.parse_options_to_config(manager, namespace, remaining_args)
namespace = manager.parse_args(args)
return PytestStylePlugin.parse_options_to_config(
manager,
namespace,
# Not sure if this is semantically correct, but this is what flake8 passes
# to plugin's parse_options
namespace.filenames,
)


def test_parse_default(option_manager):
Expand Down

0 comments on commit 705c2ad

Please sign in to comment.