Skip to content

Commit

Permalink
Update pytest and sybil
Browse files Browse the repository at this point in the history
* pytest 8.0.0
* sybil 6.0.3

Signed-off-by: Mathias L. Baumann <mathias.baumann@frequenz.com>
  • Loading branch information
Marenz committed Feb 5, 2024
1 parent c293cdd commit b80e5cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ lib = []
model = []
extra-lint-examples = [
"pylint >= 2.17.3, < 4",
"pytest >= 7.3.0, < 8",
"sybil >= 5.0.3, < 6",
"pytest >= 8, < 9",
"sybil >= 6.0.3, < 7",
]
dev-flake8 = [
"flake8 == 6.1.0",
Expand Down Expand Up @@ -101,11 +101,11 @@ dev-pylint = [
"frequenz-repo-config[dev-mkdocs,dev-noxfile,dev-pytest]",
]
dev-pytest = [
"pytest == 7.4.2",
"pytest == 8.0.0",
"pylint == 3.0.2", # We need this to check for the examples
"cookiecutter == 2.1.1", # For checking the cookiecutter scripts
"jinja2 == 3.1.2", # For checking the cookiecutter scripts
"sybil == 5.0.3", # Should be consistent with the extra-lint-examples dependency
"sybil == 6.0.3", # Should be consistent with the extra-lint-examples dependency
]
dev = [
"frequenz-repo-config[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
Expand Down
6 changes: 2 additions & 4 deletions src/frequenz/repo/config/pytest/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
import ast
import os
import subprocess
import textwrap
from pathlib import Path
from typing import Any

from sybil import Example
from sybil.evaluators.python import pad
from sybil.parsers.abstract.lexers import textwrap
from sybil.parsers.myst import CodeBlockParser

_PYLINT_DISABLE_COMMENT = (
Expand Down Expand Up @@ -116,9 +116,7 @@ def _path_to_import_statement(path: Path) -> str:
return import_statement


# We need to add the type ignore comment here because the Sybil library does not
# have type annotations.
class _CustomPythonCodeBlockParser(CodeBlockParser): # type: ignore[misc]
class _CustomPythonCodeBlockParser(CodeBlockParser):
"""Code block parser that validates extracted code examples using pylint.
This parser is a modified version of the default Python code block parser
Expand Down

0 comments on commit b80e5cb

Please sign in to comment.