Skip to content

Commit

Permalink
feat: remove deprecated --requirements-txt/--requirements-txt-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mkniewallner committed Aug 11, 2024
1 parent fd8fe49 commit b5d35e0
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 122 deletions.
26 changes: 4 additions & 22 deletions python/deptry/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@

from deptry.config import read_configuration_from_pyproject_toml
from deptry.core import Core
from deptry.deprecate.requirements_txt import (
REQUIREMENTS_TXT_DEPRECATION_MESSAGE,
REQUIREMENTS_TXT_DEV_DEPRECATION_MESSAGE,
)

if TYPE_CHECKING:
from collections.abc import Mapping, MutableMapping, Sequence
Expand Down Expand Up @@ -187,18 +183,12 @@ def display_deptry_version(ctx: click.Context, _param: click.Parameter, value: b
callback=display_deptry_version,
help="Display the current version and exit.",
)
@click.option(
"--requirements-txt", "-rt", type=COMMA_SEPARATED_TUPLE, help="To be deprecated.", hidden=True, default=()
)
@click.option(
"--requirements-txt-dev", "-rtd", type=COMMA_SEPARATED_TUPLE, help="To be deprecated.", hidden=True, default=()
)
@click.option(
"--requirements-files",
"-rf",
type=COMMA_SEPARATED_TUPLE,
help=f""".txt files to scan for dependencies. If a file called pyproject.toml with a [tool.poetry.dependencies] or [project] section is found, this argument is ignored
and the dependencies are extracted from the pyproject.toml file instead. Can be multiple e.g. `deptry . --requirements-txt req/prod.txt,req/extra.txt`
and the dependencies are extracted from the pyproject.toml file instead. Can be multiple e.g. `deptry . --requirements-files req/prod.txt,req/extra.txt`
[default: {", ".join(DEFAULT_REQUIREMENTS_FILES)}]""",
)
@click.option(
Expand Down Expand Up @@ -259,8 +249,6 @@ def deptry(
exclude: tuple[str, ...],
extend_exclude: tuple[str, ...],
ignore_notebooks: bool,
requirements_txt: tuple[str, ...],
requirements_txt_dev: tuple[str, ...],
requirements_files: tuple[str, ...],
requirements_files_dev: tuple[str, ...],
known_first_party: tuple[str, ...],
Expand All @@ -283,12 +271,6 @@ def deptry(
"""

if requirements_txt:
logging.warning(REQUIREMENTS_TXT_DEPRECATION_MESSAGE)

if requirements_txt_dev:
logging.warning(REQUIREMENTS_TXT_DEV_DEPRECATION_MESSAGE)

Core(
root=root,
config=config,
Expand All @@ -299,9 +281,9 @@ def deptry(
ignore_notebooks=ignore_notebooks,
ignore=ignore,
per_rule_ignores=per_rule_ignores,
requirements_files=(requirements_txt or requirements_files) or DEFAULT_REQUIREMENTS_FILES,
using_default_requirements_files=not (requirements_txt or requirements_files),
requirements_files_dev=requirements_txt_dev or requirements_files_dev,
requirements_files=requirements_files or DEFAULT_REQUIREMENTS_FILES,
using_default_requirements_files=not requirements_files,
requirements_files_dev=requirements_files_dev,
known_first_party=known_first_party,
json_output=json_output,
package_module_name_map=package_module_name_map,
Expand Down
Empty file.
15 changes: 0 additions & 15 deletions python/deptry/deprecate/requirements_txt.py

This file was deleted.

Empty file removed tests/unit/deprecate/__init__.py
Empty file.
85 changes: 0 additions & 85 deletions tests/unit/deprecate/test_requirements_txt.py

This file was deleted.

0 comments on commit b5d35e0

Please sign in to comment.