Skip to content

Make --no-clean work in tox #2689

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

Closed
wants to merge 2 commits into from
Closed

Conversation

habnabit
Copy link

@habnabit habnabit commented Apr 15, 2015

Right now, --no-clean will preserve the build directory that pip created during the installation, but everything in the directory is deleted. It's not useful to keep the build directory if there's nothing in it, so this fixes the issue by not deleting things inside the build directory unconditionally.

The problem is that --no-clean will retain the build directory, but
deletes everything in the build directory. Ultimately this makes
--no-clean useless because the reason to retain the build directory is
to investigate the contents.
This fixes the bug demonstrated in
ef522ac while not introducing any
regressions. There's another call to .remove_temporary_source() in a
different place which already tests if --no-clean was specified.
@qwcode
Copy link
Contributor

qwcode commented Apr 15, 2015

what pip version? can you provide a paste.
global build dir or in a virtualenv?

here's a paste of it preserving the contents of the build dir in v6.1.1

https://gist.github.com/qwcode/7ac7377b5a88872b0343

@habnabit
Copy link
Author

Demo code: https://gist.github.com/habnabit/d8e8f5c5c925d19c5ece
Output for me: https://gist.github.com/habnabit/e97a07d7bda97befb0c4

This is the smallest I can make the example; I haven't tried very hard to factor tox out, but it might certainly be related to tox.

@qwcode
Copy link
Contributor

qwcode commented May 13, 2015

the problem seems to be when installing from local dists or local projects, not a problem in general. in your tox example, tox installs from a local zip, so it fits the problem.

I opened #2779 so we have an issue for this.

as for your fix, I'm not sure, I need to look closer...

@qwcode qwcode changed the title Make --no-clean actually do something useful (keep the files in the build directory) Make --no-clean work in tox May 13, 2015
@rbtcollins
Copy link

@habnabit can I ask what this is for? we were debating the usefulness of this flag earlier today on the #pypa-dev IRC channel... we think its mainly debugging. I'm asking because the resolver work (PR #2716) necessitates changing the build cache, and I've taken a bit of a cleaver to it...

@habnabit
Copy link
Author

@rbtcollins yes, this is primarily for debugging. I can't think of a non-debugging use case offhand.

@dstufft dstufft closed this May 18, 2016
@dstufft
Copy link
Member

dstufft commented May 18, 2016

Accidentally closed this, reopening. Sorry!

@dstufft dstufft reopened this May 18, 2016
@BrownTruck
Copy link
Contributor

Hello!

As part of an effort to ease the contribution process and adopt a more standard workflow pip has switched to doing development on the master branch. However, this Pull Request was made against the develop branch so it will need to be resubmitted against master.

If you do nothing, this Pull Request will be automatically migrated by @BrownTruck for you.

If you would like to retain control over this pull request then you should resubmit it against the master branch, closing and referencing the original Pull Request.

If you choose to migrate this Pull Request yourself, here is an example message that you can copy and paste:

Right now, --no-clean will preserve the build directory that pip created during the installation, but everything in the directory is deleted. It's not useful to keep the build directory if there's nothing in it, so this fixes the issue by not deleting things inside the build directory unconditionally.

---

*This was migrated from pypa/pip#2689 to reparent it to the ``master`` branch. Please see original pull request for any previous discussion.*

If this pull request is no longer needed, please feel free to close it.

@BrownTruck
Copy link
Contributor

This Pull Request has been automatically migrated to #3754 to reparent it to the master branch. Please see the new pull request for any new discussion.

@BrownTruck BrownTruck closed this May 26, 2016
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 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.

5 participants