-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
exclude '.tox', '.nox' from being copied during 'pip install .' #6770
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3626530
exclude '.tox', '.nox', '.git', '.hg', '.bzr', '.svn' from pip instal…
omry 82e89a9
news
omry f285407
lint
omry e833052
lint take 2 (not sure how to test locally)
omry 67ce442
fixed lint, excludes only .tox and .nox
omry 29a8b6e
updated news
omry 459b4dc
renamed news file to match PR
omry 6b1aa6f
simplifies new language
omry d4171f2
minor updates
omry 77c1504
unit test
omry e67f066
fixed on python 2.7
omry 8e87980
responding to comments
omry ec47c86
updated docs
omry 6dd5727
responded to comments
omry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Skip copying .tox and .nox directories to temporary build directories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
from pip._internal.models.link import Link | ||
from pip._internal.utils.hashes import Hashes | ||
from pip._internal.utils.misc import path_to_url | ||
from tests.lib import create_file | ||
from tests.lib import Path, create_file | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
|
@@ -413,6 +413,41 @@ def test_unpack_file_url_thats_a_dir(self, tmpdir, data): | |
assert os.path.isdir(os.path.join(self.build_dir, 'fspkg')) | ||
|
||
|
||
@pytest.mark.parametrize('exclude_dir', [ | ||
'.nox', | ||
'.tox' | ||
]) | ||
def test_unpack_file_url_excludes_expected_dirs(tmpdir, exclude_dir): | ||
src_dir = tmpdir / 'src' | ||
dst_dir = tmpdir / 'dst' | ||
src_included_file = Path.joinpath(src_dir, 'file.txt') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, my previous comment was not very good - I meant using the |
||
src_excluded_dir = Path.joinpath(src_dir, exclude_dir) | ||
src_excluded_file = Path.joinpath(src_dir, exclude_dir, 'file.txt') | ||
src_included_dir = Path.joinpath(src_dir, 'subdir', exclude_dir) | ||
|
||
# set up source directory | ||
src_excluded_dir.mkdir(parents=True) | ||
src_included_dir.mkdir(parents=True) | ||
Path.touch(src_included_file) | ||
Path.touch(src_excluded_file) | ||
|
||
dst_included_file = Path.joinpath(dst_dir, 'file.txt') | ||
dst_excluded_dir = Path.joinpath(dst_dir, exclude_dir) | ||
dst_excluded_file = Path.joinpath(dst_dir, exclude_dir, 'file.txt') | ||
dst_included_dir = Path.joinpath(dst_dir, 'subdir', exclude_dir) | ||
|
||
src_link = Link(path_to_url(src_dir)) | ||
unpack_file_url( | ||
src_link, | ||
dst_dir, | ||
download_dir=None | ||
) | ||
assert not os.path.isdir(dst_excluded_dir) | ||
assert not os.path.isfile(dst_excluded_file) | ||
assert os.path.isfile(dst_included_file) | ||
assert os.path.isdir(dst_included_dir) | ||
|
||
|
||
class TestSafeFileCache: | ||
""" | ||
The no_perms test are useless on Windows since SafeFileCache uses | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say
regular installation
just so people don't get the idea that it may apply to editable installs.