Skip to content

Commit

Permalink
Remove exclude
Browse files Browse the repository at this point in the history
It is already built into ``pip``
  • Loading branch information
realshouzy committed Feb 26, 2024
1 parent 0cd42db commit 348b8d8
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions pip_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"not-required",
"exclude-editable",
"include-editable",
"exclude",
),
)

Expand Down Expand Up @@ -133,13 +134,6 @@ def _parse_args(
default=False,
help="Automatically install every update found",
)
parser.add_argument(
"--exclude",
"-e",
action="append",
default=[],
help="Exclude package from update",
)
parser.add_argument(
"--continue-on-fail",
"-C",
Expand Down Expand Up @@ -305,7 +299,6 @@ def update_packages(

def _get_outdated_packages(
forwarded: list[str],
exclude: AbstractSet[str],
) -> list[_Package]:
command: list[str] = [
*_PIP_CMD,
Expand All @@ -317,7 +310,7 @@ def _get_outdated_packages(
]
output: str = subprocess.check_output(command).decode("utf-8") # nosec
packages: list[_Package] = [_Package.from_dct(pkg) for pkg in json.loads(output)]
return [pkg for pkg in packages if pkg.name not in exclude] if exclude else packages
return packages


class _Column(NamedTuple):
Expand Down Expand Up @@ -376,10 +369,7 @@ def main(argv: Sequence[str] | None = None) -> int:
logger.error("--raw and --interactive cannot be used together")
return 1

outdated: list[_Package] = _get_outdated_packages(
list_args,
set(args.exclude),
)
outdated: list[_Package] = _get_outdated_packages(list_args)

if not outdated and not args.raw:
logger.info("Everything up-to-date")
Expand Down

0 comments on commit 348b8d8

Please sign in to comment.