Skip to content

Commit

Permalink
Merge pull request #168 from r1chardj0n3s/ruff-format
Browse files Browse the repository at this point in the history
Remove black in favour of ruff format
  • Loading branch information
adamtheturtle authored Oct 25, 2023
2 parents a8cdb86 + a01b7de commit 1d8199c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
run: |
mypy .
ruff .
black --check .
ruff format --check .
pip-extra-reqs pip_check_reqs
pip-missing-reqs pip_check_reqs
pylint pip_check_reqs tests
Expand Down
9 changes: 4 additions & 5 deletions pip_check_reqs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
from dataclasses import dataclass, field
from importlib.util import find_spec
from pathlib import Path
from typing import (
Callable,
Generator,
Iterable,
)
from typing import TYPE_CHECKING, Callable

from packaging.markers import Marker
from packaging.utils import NormalizedName, canonicalize_name
Expand All @@ -24,6 +20,9 @@

from . import __version__

if TYPE_CHECKING:
from collections.abc import Generator, Iterable

log = logging.getLogger(__name__)


Expand Down
4 changes: 3 additions & 1 deletion pip_check_reqs/find_extra_reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import sys
from functools import cache
from pathlib import Path
from typing import TYPE_CHECKING, Callable, Iterable
from typing import TYPE_CHECKING, Callable
from unittest import mock

from packaging.utils import NormalizedName, canonicalize_name
Expand All @@ -23,6 +23,8 @@
from pip_check_reqs.common import version_info

if TYPE_CHECKING:
from collections.abc import Iterable

from pip._internal.req.req_file import ParsedRequirement

log = logging.getLogger(__name__)
Expand Down
5 changes: 4 additions & 1 deletion pip_check_reqs/find_missing_reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import sys
from functools import cache
from pathlib import Path
from typing import Callable, Iterable
from typing import TYPE_CHECKING, Callable
from unittest import mock

from packaging.utils import NormalizedName, canonicalize_name
Expand All @@ -25,6 +25,9 @@
from pip_check_reqs import common
from pip_check_reqs.common import FoundModule, version_info

if TYPE_CHECKING:
from collections.abc import Iterable

log = logging.getLogger(__name__)


Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,13 @@
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words = 'no'

[tool.black]

line-length = 79

[tool.mypy]

strict = true

[tool.ruff]

target-version = "py38"
target-version = "py39"

select = ["ALL"]

Expand Down
1 change: 0 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
black
ruff
mypy
pyenchant
Expand Down
4 changes: 2 additions & 2 deletions tests/test_find_extra_reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import textwrap
from typing import TYPE_CHECKING

import black
import pip # This happens to be installed in the test environment.
import pytest

from pip_check_reqs import common, find_extra_reqs
Expand All @@ -17,7 +17,7 @@

def test_find_extra_reqs(tmp_path: Path) -> None:
installed_not_imported_required_package = pytest
installed_imported_required_package = black
installed_imported_required_package = pip

fake_requirements_file = tmp_path / "requirements.txt"
fake_requirements_file.write_text(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_find_missing_reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import textwrap
from pathlib import Path

import black
import pip # This happens to be installed in the test environment.
import pytest

from pip_check_reqs import common, find_missing_reqs


def test_find_missing_reqs(tmp_path: Path) -> None:
installed_imported_not_required_package = pytest
installed_imported_required_package = black
installed_imported_required_package = pip

fake_requirements_file = tmp_path / "requirements.txt"
fake_requirements_file.write_text(
Expand Down

0 comments on commit 1d8199c

Please sign in to comment.