-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Continuing Feature/record download info #507
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
Closed
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d1e010c
add the url we downloaded from to the InstallRequirement, and then re…
dstufft dbfa932
record the requirements line used to cause this package to install
dstufft 14502cc
make requirement_line the line that was passed to it and add support …
dstufft 25fcbd9
refactor handling of the info.ini file into a method that is passed a…
dstufft 43ea7d0
add tests to test info.ini on different types of installs
dstufft 7c187ca
change the name from info.ini to pip.ini
dstufft a706574
use the available methods to get the egg info dir
dstufft 488b29d
Merge branch 'refs/heads/develop' into feature/record-download-info
tgecho efaf106
Cleaned up info_file tests based on discussion in https://github.com/…
tgecho 9990c26
Add branch to travis ci
tgecho 5c6c0f9
Consolidated some of the testing code.
tgecho 79b6114
Remove iteritems() for py3 compatibility.
tgecho 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 hidden or 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 |
---|---|---|
|
@@ -12,5 +12,6 @@ notifications: | |
branches: | ||
only: | ||
- develop | ||
- feature/record-download-info | ||
env: | ||
- PIP_USE_MIRRORS=true |
This file contains hidden or 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 hidden or 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,61 @@ | ||
import os | ||
|
||
from pip.backwardcompat import ConfigParser | ||
from pip.download import path_to_url2 | ||
from tests.test_pip import here, reset_env, run_pip, pyversion | ||
|
||
from tests.path import Path | ||
|
||
|
||
def get_pip_ini(egg_info_dir): | ||
infofp = open(os.path.join(egg_info_dir, "pip.ini")) | ||
info = ConfigParser.RawConfigParser() | ||
info.readfp(infofp) | ||
infofp.close() | ||
return info | ||
|
||
|
||
def test_index(): | ||
""" | ||
Test that the pip.ini is written and works from an index (PyPI). | ||
""" | ||
env = reset_env() | ||
run_pip('install', '-i http://pypi.python.org/simple/', 'INITools==0.3.1') | ||
|
||
egg_info_dir = env.base_path / env.site_packages / 'INITools-0.3.1-py%s.egg-info' % pyversion | ||
info = get_pip_ini(egg_info_dir) | ||
|
||
assert info.has_section("download") | ||
assert info.get("download", "url").startswith("http://pypi.python.org/packages/source/I/INITools/INITools") | ||
assert info.get("download", "requirement") == "INITools==0.3.1" | ||
|
||
|
||
def test_tarball(): | ||
""" | ||
Test that the pip.ini is written and works from an tarball. | ||
""" | ||
env = reset_env() | ||
run_pip('install', 'http://pypi.python.org/packages/source/I/INITools/INITools-0.3.1.tar.gz') | ||
|
||
egg_info_dir = env.base_path / env.site_packages / 'INITools-0.3.1-py%s.egg-info' % pyversion | ||
info = get_pip_ini(egg_info_dir) | ||
|
||
assert info.has_section("download") | ||
assert info.get("download", "url") == "http://pypi.python.org/packages/source/I/INITools/INITools-0.3.1.tar.gz" | ||
assert info.get("download", "requirement") == "http://pypi.python.org/packages/source/I/INITools/INITools-0.3.1.tar.gz" | ||
|
||
|
||
def test_editable(): | ||
""" | ||
Test that the pip.ini is written and works from an editable. | ||
""" | ||
env = reset_env() | ||
fspkg = path_to_url2(Path(here) / 'packages' / 'FSPkg') | ||
run_pip('install', '-e', fspkg) | ||
|
||
egg_info_dir = Path(here) / 'packages' / 'FSPkg' / 'FSPkg.egg-info' | ||
info = get_pip_ini(egg_info_dir) | ||
|
||
assert info.has_section("download") | ||
assert info.get("download", "url") == fspkg | ||
assert info.get("download", "requirement") == "--editable=" + fspkg |
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.
this addition should not be part of the pull request