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

Refactor and cleannup some cruft code around no_deps flag. #5164

Merged
merged 2 commits into from Jul 7, 2022

Conversation

matteius
Copy link
Member

@matteius matteius commented Jul 6, 2022

The issue

Replacement PR for really old PR: #3985

The fix

Cleans up some impossible code paths and a logical bug where a flag gets overwritten once in a loop and then retries are caused.

The checklist

  • Associated issue
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix, .feature, .behavior, .doc. .vendor. or .trivial (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

@@ -1459,7 +1457,7 @@ def pip_install(
r=None,
allow_global=False,
ignore_hashes=False,
no_deps=None,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing that calls this ever passed anything other than True/False and the default behavior is False -- meaning install all dependencies. Skipping dependency installs is the special case of True being passed.

@@ -720,7 +720,6 @@ def batch_install(
if sequential_deps is None:
sequential_deps = []
failed = not retry
install_deps = not no_deps
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially moving this to line 759 is what the original PR did that this replaces -- the reason why is because line 757 can override this for a specific artifact, but we should not use that flag for all iterations of the loop.

@@ -1503,14 +1501,6 @@ def pip_install(
extra_indexes = list(project.sources)
if requirement and requirement.vcs or requirement.editable:
requirement.index = None
# Install dependencies when a package is a non-editable VCS dependency.
# Don't specify a source directory when using --system.
if not requirement.editable and no_deps is not True:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment indicated this first block was due to really really old Pipfile.lock and no tests fail around this.

# Leave this off because old Pipfile.lock don't have all deps included
# TODO: When can it be turned back on?
no_deps = False
elif requirement.editable and no_deps is None:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no_deps was never actually None.

@oz123 oz123 merged commit 31f5072 into main Jul 7, 2022
@oz123 oz123 deleted the refactor_no_deps branch July 7, 2022 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants