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

Cmds {install,wheel} should return proper error code #1162

Merged
merged 1 commit into from
Aug 27, 2013
Merged

Cmds {install,wheel} should return proper error code #1162

merged 1 commit into from
Aug 27, 2013

Conversation

clarete
Copy link
Contributor

@clarete clarete commented Aug 22, 2013

The pip executable was returning a successful status code (0) when
trying to install new packages with existing previous build directories.

from @qwcode: the reason to include in 1.4.2 is that this also contains a fix so that a PreviousBuildDirError prevents cleaning of the previous build dir (even when the build dir has a pip delete marker; if it previously exists with a delete marker, then it is safe to assume it was intentionally left, using --no-clean or --no-install, so should be left intact)

@@ -261,8 +261,6 @@ def run(self, options, args):
elif self.bundle:
requirement_set.create_bundle(self.bundle_filename)
logger.notify('Created bundle in %s' % self.bundle_filename)
except PreviousBuildDirError:
return
Copy link
Contributor

Choose a reason for hiding this comment

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

ouch, this return was still not preventing cleaning. the finally still runs.
but a previous build dir needs to prevent cleaning.
there is a test to confirm cleaning doesn't happen in this case, but I see it's broken.

so 3 recommended changes:

  1. keep the except, but instead of the return, set options.no_clean=True, which the finally checks for
  2. fix the broken test https://github.com/pypa/pip/blob/develop/tests/functional/test_install_cleanup.py#L131 . for it to be worthwhile, it needs this call write_delete_marker_file(script.venv_path/'build'). cleanup will never happen on a dir, unless it contains pip's delete marker.
  3. log this against 1.4.X (not develop), so it can be included in 1.4.2

the reason to include in 1.4.2, is that we're still deleting what we specifically said we wouldn't.

If you don't get to this, I will probably handle it on monday.

and thanks for doing this PR. overall, much better.

Copy link
Contributor

Choose a reason for hiding this comment

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

cc @dstufft about adding this to 1.4.2

Copy link
Contributor

Choose a reason for hiding this comment

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

regarding #1 above, re-raise after setting options.no_clean=True

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @qwcode, I just pushed a small update to the PR, let me know what you think about it

@clarete
Copy link
Contributor Author

clarete commented Aug 23, 2013

Thank you so much for your review @qwcode, I'll follow your instructions and improve the patch! :)

The `pip` executable was returning a successful status code (`0`) when
trying to install new packages with existing previous build directories.
qwcode added a commit that referenced this pull request Aug 27, 2013
Cmds {install,wheel} should return proper error code
@qwcode qwcode merged commit ecec569 into pypa:develop Aug 27, 2013
@qwcode
Copy link
Contributor

qwcode commented Aug 27, 2013

and I also backported into 1.4.X

@clarete
Copy link
Contributor Author

clarete commented Aug 27, 2013

Thank you, I'm just excited to do more stuff on pip, you guys rock! :)

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 5, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants