From 7c13e826ed5df38f56c7b330968baf6caa4a1bcb Mon Sep 17 00:00:00 2001 From: tolstislon Date: Mon, 29 Dec 2025 16:16:54 +0300 Subject: [PATCH] Added support for python 3.14 --- .github/workflows/python-package.yml | 4 +- Pipfile | 6 +-- ruff.toml | 72 +++++++++++++++++++++++++++- setup.py | 1 + string_gen/generator.py | 4 +- 5 files changed, 79 insertions(+), 8 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ac7eb27..ce9d84d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ] + python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ] steps: - uses: actions/checkout@v2 @@ -25,7 +25,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest pytest-cov ruff==0.11.8 + python -m pip install pytest pytest-cov ruff==0.14.10 python -m pip install -e . - name: Format check run: | diff --git a/Pipfile b/Pipfile index 295d91b..1d013e0 100644 --- a/Pipfile +++ b/Pipfile @@ -7,9 +7,9 @@ name = "pypi" string_gen = { editable = true, path = "." } [dev-packages] -pytest = "==8.3.5" -pytest-cov = "==6.1.1" -ruff = "==0.11.8" +pytest = "==9.0.2" +pytest-cov = "==7.0.0" +ruff = "==0.14.10" [requires] python_version = "3.12" diff --git a/ruff.toml b/ruff.toml index e2b4fe7..902d84d 100644 --- a/ruff.toml +++ b/ruff.toml @@ -33,6 +33,74 @@ select = [ "FLY", # flynt "PL", # Pylint "RSE", # flake8-raise + "ERA", # eradicate (Закомменченый код) + "BLE", # flake8-blind-except + "FBT", # flake8-boolean-trap + "DTZ", # flake8-datetimez + "INT", # flake8-gettext + "TC", # flake8-type-checking + "W", # pycodestyle (warning) + "PLR", # Refactor + "PLW", # Warning + "TRY", # Warning + "ASYNC", # flake8-async + "T10", # flake8-debugger + "EM", # flake8-errmsg + "EXE", # flake8-executable + "LOG", # flake8-logging + "G", # flake8-logging-format + "SLF", # flake8-self + "SLOT", # flake8-slots + "TID", # flake8-tidy-imports + "PLE", # Pylint Error "A", # flake8-builtins + "ANN", # flake8-annotations + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "COM", # flake8-commas + "D", # pydocstyle + "E", # pycodestyle + "F", # Pyflakes + "FURB", # refurb + "I", # isort + "ICN", # flake8-import-conventions + "ISC", # flake8-implicit-str-concat + "N", # pep8-naming + "PERF", # Perflint + "PGH", # pygrep-hooks + "PTH", # flake8-use-pathlib + "RUF", # Ruff-specific rules + "S", # flake8-bandit + "T20", # flake8-print + "UP", # pyupgrade + "PIE", # flake8-pie + "PT", # flake8-pytest-style + "Q", # flake8-quotes + "RET", # flake8-return + "SIM", # flake8-simplify + "ARG", # flake8-unused-arguments + "FLY", # flynt + "PL", # Pylint + "RSE", # flake8-raise + "ERA", # eradicate (Закомменченый код) + "BLE", # flake8-blind-except + "FBT", # flake8-boolean-trap + "DTZ", # flake8-datetimez + "INT", # flake8-gettext + "TC", # flake8-type-checking + "W", # pycodestyle (warning) + "PLR", # Refactor + "PLW", # Warning + "TRY", # Warning + "ASYNC", # flake8-async + "T10", # flake8-debugger + "EM", # flake8-errmsg + "EXE", # flake8-executable + "LOG", # flake8-logging + "G", # flake8-logging-format + "SLF", # flake8-self + "SLOT", # flake8-slots + "TID", # flake8-tidy-imports + "PLE", # Pylint Error ] ignore = [ "D105", # Missing docstring in magic method @@ -43,10 +111,12 @@ ignore = [ "D203", # one-blank-line-before-class (conflicts rules) "COM812", # conflicts rules "ISC001", # conflicts rules + "TRY003", # Avoid specifying long messages outside the exception class + "EM102", # Exception must not use an f-string literal, assign to variable first ] [lint.per-file-ignores] -"test_*.py" = ["S101", "D103", "ANN201", "PLR2004"] +"test_*.py" = ["S101", "D103", "ANN201", "PLR2004", "FBT001"] [lint.flake8-pytest-style] parametrize-values-row-type = "tuple" diff --git a/setup.py b/setup.py index a605918..465a510 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,7 @@ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing", diff --git a/string_gen/generator.py b/string_gen/generator.py index e1193b4..fa87077 100644 --- a/string_gen/generator.py +++ b/string_gen/generator.py @@ -103,7 +103,7 @@ def value(self, pattern: re.Pattern) -> str: } -class StringGen: +class StringGen: # noqa: PLW1641 """Base class for generating strings.""" __slots__ = ("_parser", "_pattern") @@ -122,7 +122,7 @@ def pattern(self) -> re.Pattern: def __get_value(self, value: Any) -> re.Pattern: if isinstance(value, type(self)): - return value._pattern + return value._pattern # noqa: SLF001 if isinstance(value, re.Pattern): return value if isinstance(value, (str, bytes)):