Skip to content

Commit

Permalink
Dont check packages with ignore_dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
q0w committed Mar 23, 2022
1 parent 9386757 commit a8944bf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/pip/_internal/operations/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def check_install_conflicts(to_install: List[InstallRequirement]) -> ConflictDet
# Start from the current state
package_set, _ = create_package_set_from_installed()
# Install packages
would_be_installed = _simulate_installation_of(to_install, package_set)
would_be_installed = _simulate_installation_of(
list(filter(lambda x: not x.ignore_dependencies, to_install)), package_set
)

# Only warn about directly-dependent packages; create a whitelist of them
whitelist = _create_whitelist(would_be_installed, package_set)
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/req/constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def install_req_from_line(
install_options=options.get("install_options", []) if options else [],
global_options=options.get("global_options", []) if options else [],
hash_options=options.get("hashes", {}) if options else {},
ignore_dependencies=options.get("ignore_dependencies", False)
ignore_dependencies=options.get("ignore_dependencies", ignore_dependencies)
if options
else ignore_dependencies,
constraint=constraint,
Expand Down
2 changes: 0 additions & 2 deletions src/pip/_internal/req/req_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ def handle_requirement_line(
if options:
# Disable wheels if the user has specified build options
cmdoptions.check_install_build_global(options, line.opts)
if line.opts.ignore_dependencies:
options.ignore_dependencies = True

# get the options that apply to requirements
req_options = {}
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/resolution/resolvelib/candidates.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def _make_install_req_from_dist(
install_options=template.install_options,
global_options=template.global_options,
hashes=template.hash_options,
ignore_dependencies=template.ignore_dependencies,
),
)
ireq.satisfied_by = dist
Expand Down
5 changes: 2 additions & 3 deletions src/pip/_internal/resolution/resolvelib/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,9 @@ def is_satisfied_by(self, requirement: Requirement, candidate: Candidate) -> boo

def get_dependencies(self, candidate: Candidate) -> Sequence[Requirement]:
install_req = candidate.get_install_requirement()
if install_req:
with_requires = not self._ignore_dependencies
if install_req and with_requires:
with_requires = not install_req.ignore_dependencies
else:
with_requires = not self._ignore_dependencies
return [r for r in candidate.iter_dependencies(with_requires) if r is not None]

@staticmethod
Expand Down

0 comments on commit a8944bf

Please sign in to comment.