Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix crash when updating libraries with multiple manifests
If a library has both a pyproject.toml file and a standard requirements.txt file, we'd end up using the `:widen` strategy for the dependencies in the `requirements.txt` file and eventually crashing with an error like the following: ``` /home/dependabot/dependabot-core/common/lib/dependabot/update_checkers/base.rb:266:in `block in preferred_version_resolvable_with_unlock?': undefined method `[]' for nil:NilClass (NoMethodError) updated_requirements.none? { |r| r[:requirement] == :unfixable } ^^^^^^^^^^^^^^ from /home/dependabot/dependabot-core/common/lib/dependabot/update_checkers/base.rb:266:in `none?' from /home/dependabot/dependabot-core/common/lib/dependabot/update_checkers/base.rb:266:in `preferred_version_resolvable_with_unlock?' from /home/dependabot/dependabot-core/common/lib/dependabot/update_checkers/base.rb:249:in `numeric_version_can_update?' from /home/dependabot/dependabot-core/common/lib/dependabot/update_checkers/base.rb:199:in `version_can_update?' from /home/dependabot/dependabot-core/common/lib/dependabot/update_checkers/base.rb:44:in `can_update?' from bin/dry-run.rb:709:in `block in <main>' from bin/dry-run.rb:661:in `each' from bin/dry-run.rb:661:in `<main>' ``` I think the crash happens because the requirements.txt file updater does not supoort the `:widen` strategy. So my fix is to fallback to `increase` in this case, since requirements.txt files usually include pinned dependencies so widening probably doesn't make much sense there.
- Loading branch information