Skip to content

Commit

Permalink
Update dependency ruff to v0.6.8 (#1900)
Browse files Browse the repository at this point in the history
* Update dependency ruff to v0.6.8

* Run `ruff check .` instead of `ruff .` due to ruff error

* Preface ruff lint keys with .lint to address ruff deprecation warning

* Changes to appease ruff linter

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micah Jerome Ellison <[email protected]>
  • Loading branch information
renovate[bot] and micahellison authored Oct 1, 2024
1 parent 4d84c49 commit 17e1ba6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 28 deletions.
37 changes: 19 additions & 18 deletions poetry.lock

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

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ lint.sequence = [
"poetry --version",
"poetry check",
"ruff --version",
"ruff .",
"ruff check .",
"black --version",
"black --check ."
]
Expand Down Expand Up @@ -130,7 +130,7 @@ line-length = 88
target-version = "py310"

# https://beta.ruff.rs/docs/rules/
select = [
lint.select = [
'F', # Pyflakes
'E', # pycodestyle errors
'W', # pycodestyle warnings
Expand All @@ -149,11 +149,11 @@ select = [
]
exclude = [".git", ".tox", ".venv", "node_modules"]

[tool.ruff.isort]
[tool.ruff.lint.isort]
force-single-line = true
known-first-party = ["jrnl", "tests"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # unused imports

[build-system]
Expand Down
4 changes: 2 additions & 2 deletions tests/lib/given_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from datetime import datetime
from unittest.mock import MagicMock
from unittest.mock import patch
from xml.etree import ElementTree
from xml.etree import ElementTree as ET

from pytest_bdd import given
from pytest_bdd.parsers import parse
Expand Down Expand Up @@ -168,7 +168,7 @@ def parse_output_as_language(cli_run, language_name):
actual_output = cli_run["stdout"]

if language_name == "XML":
parsed_output = ElementTree.fromstring(actual_output)
parsed_output = ET.fromstring(actual_output)
elif language_name == "JSON":
parsed_output = json.loads(actual_output)
else:
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/then_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import os
import re
from xml.etree import ElementTree
from xml.etree import ElementTree as ET

from pytest_bdd import then
from pytest_bdd.parsers import parse
Expand Down Expand Up @@ -300,7 +300,7 @@ def cache_dir_contains_files(file_list, cache_dir):
def assert_output_is_valid_language(cli_run, language_name):
language_name = language_name.upper()
if language_name == "XML":
xml_tree = ElementTree.fromstring(cli_run["stdout"])
xml_tree = ET.fromstring(cli_run["stdout"])
assert xml_tree, "Invalid XML"
elif language_name == "JSON":
assert json.loads(cli_run["stdout"]), "Invalid JSON"
Expand Down Expand Up @@ -390,7 +390,7 @@ def assert_output_field_content(field_name, comparison, expected_keys, parsed_ou
@then(parse('there should be {number:d} "{item}" elements'))
def count_elements(number, item, cli_run):
actual_output = cli_run["stdout"]
xml_tree = ElementTree.fromstring(actual_output)
xml_tree = ET.fromstring(actual_output)
assert len(xml_tree.findall(".//" + item)) == number


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_parse_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ class TestDeserialization:
)
def test_deserialize_multiword_strings(self, input_str):
runtime_config = make_yaml_valid_dict(input_str)
assert runtime_config.__class__ == dict
assert runtime_config.__class__ is dict
assert input_str[0] in runtime_config
assert runtime_config[input_str[0]] == input_str[1]

Expand Down

0 comments on commit 17e1ba6

Please sign in to comment.