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

feat: remove deprecated --requirements-txt/--requirements-txt-dev #819

Merged
merged 2 commits into from
Aug 25, 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
28 changes: 5 additions & 23 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,26 +183,20 @@ 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(
"--requirements-files-dev",
"-rfd",
type=COMMA_SEPARATED_TUPLE,
help=""".txt files to scan for additional development 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-dev req/dev.txt,req/test.txt`""",
and the dependencies are extracted from the pyproject.toml file instead. Can be multiple e.g. `deptry . --requirements-files-dev req/dev.txt,req/test.txt`""",
default=("dev-requirements.txt", "requirements-dev.txt"),
show_default=True,
)
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.

Loading