Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#8236)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jul 25, 2023
1 parent 9ed457b commit 5571d81
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ repos:
- id: validate_manifest

- repo: /~https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
rev: v0.0.280
hooks:
- id: ruff
2 changes: 1 addition & 1 deletion src/poetry/mixology/incompatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __str__(self) -> str:
if len(positive) != 1:
return f"if {' and '.join(positive)} then {' or '.join(negative)}"

positive_term = [term for term in self._terms if term.is_positive()][0]
positive_term = next(term for term in self._terms if term.is_positive())
return (
f"{self._terse(positive_term, allow_every=True)} requires"
f" {' or '.join(negative)}"
Expand Down
4 changes: 2 additions & 2 deletions tests/puzzle/test_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2233,7 +2233,7 @@ def test_solver_can_resolve_git_dependencies_with_ref(
"0.1.2",
source_type="git",
source_url="/~https://github.com/demo/demo.git",
source_reference=ref[list(ref.keys())[0]],
source_reference=ref[next(iter(ref.keys()))],
source_resolved_reference=MOCK_DEFAULT_GIT_REVISION,
)

Expand All @@ -2253,7 +2253,7 @@ def test_solver_can_resolve_git_dependencies_with_ref(
op = ops[1]

assert op.package.source_type == "git"
assert op.package.source_reference == ref[list(ref.keys())[0]]
assert op.package.source_reference == ref[next(iter(ref.keys()))]
assert op.package.source_resolved_reference is not None
assert op.package.source_resolved_reference.startswith("9cf87a2")

Expand Down
4 changes: 2 additions & 2 deletions tests/repositories/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def html_page_content() -> HTMLPageGetter:
def _fixture(content: str, base_url: str | None = None) -> str:
base = f'<base href="{base_url}"' if base_url else ""
return """
return f"""
<!DOCTYPE html>
<html>
<head>
Expand All @@ -26,6 +26,6 @@ def _fixture(content: str, base_url: str | None = None) -> str:
{content}
</body>
</html>
""".format(content=content, base=base)
"""

return _fixture
4 changes: 2 additions & 2 deletions tests/repositories/link_sources/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def test_link_attributes(
page = HTMLPage("https://example.org", content)

assert len(list(page.links)) == 1
link = list(page.links)[0]
link = next(iter(page.links))
assert link.url == expected_link.url
assert link.requires_python == expected_link.requires_python
assert link.yanked == expected_link.yanked
Expand Down Expand Up @@ -111,5 +111,5 @@ def test_base_url(
) -> None:
content = html_page_content(anchor, base_url)
page = HTMLPage("https://example.org", content)
link = list(page.links)[0]
link = next(iter(page.links))
assert link.url == expected

0 comments on commit 5571d81

Please sign in to comment.