Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use ruff format #9077

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@ repos:
- id: debug-statements
- id: check-docstring-first

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.2.0
hooks:
- id: black
exclude: tests/([^/]*/)*fixtures/

- repo: https://github.com/pre-commit/pre-commit
rev: v3.6.2
hooks:
- id: validate_manifest

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.2.2
rev: v0.3.0
hooks:
- id: ruff
- id: ruff
- id: ruff-format
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ required-imports = ["from __future__ import annotations"]
[tool.ruff.lint.per-file-ignores]
"src/poetry/console/*" = ["RUF012"] # Can't annotate properly until new version of Cleo

[tool.black]
target-version = ['py38']
preview = true
extend-exclude = "tests/([^/]*/)*fixtures/"

[tool.mypy]
files = "src, tests"
mypy_path = "src"
Expand Down
6 changes: 3 additions & 3 deletions src/poetry/layouts/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ def generate_poetry_content(self) -> TOMLDocument:

if self._dev_dependencies:
for dep_name, dep_constraint in self._dev_dependencies.items():
poetry_content["group"]["dev"]["dependencies"][
dep_name
] = dep_constraint
poetry_content["group"]["dev"]["dependencies"][dep_name] = (
dep_constraint
)
else:
del poetry_content["group"]

Expand Down
4 changes: 1 addition & 3 deletions tests/console/commands/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,9 +903,7 @@ def test_init_existing_pyproject_consistent_linesep(
existing_section = """
[tool.black]
line-length = 88
""".replace(
"\n", linesep
)
""".replace("\n", linesep)
with open(pyproject_file, "w", newline="") as f:
f.write(existing_section)
tester.execute(inputs=init_basic_inputs)
Expand Down
4 changes: 1 addition & 3 deletions tests/packages/test_locker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,7 @@ def test_lock_file_resolves_file_url_symlinks(root: ProjectPackage) -> None:
dir=d1
) as d4, tempfile.TemporaryDirectory(dir=d2) as d3, tempfile.NamedTemporaryFile(
dir=d4
) as source_file, tempfile.NamedTemporaryFile(
dir=d3
) as lock_file:
) as source_file, tempfile.NamedTemporaryFile(dir=d3) as lock_file:
lock_file.close()
try:
os.symlink(Path(d3), symlink_path)
Expand Down
1 change: 0 additions & 1 deletion tests/utils/env/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


if TYPE_CHECKING:

from poetry.poetry import Poetry
from tests.types import FixtureDirGetter
from tests.types import ProjectFactory
Expand Down
1 change: 0 additions & 1 deletion tests/utils/env/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


if TYPE_CHECKING:

from pytest_mock import MockerFixture

from poetry.poetry import Poetry
Expand Down
Loading