1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
Commit graph

151 commits

Author SHA1 Message Date
Xavier Fernandez
9aa5e8f5c0 Let's try always returning text
and hope https://github.com/pypa/pip/issues/1441 is behind us
2016-03-04 10:50:29 +01:00
Xavier Fernandez
e2889268bd utils: decode requirement files according to their BOM if present 2016-03-04 10:50:29 +01:00
Stephan Erb
23f0618576 Use pre-defined chunksizes instead of hardcoded ones.
The requests one does currently sit at 10KB, the io buffer one at 8KB.
Both are reasonable values and slightly above our current values.

If those values are adjusted, we will profit as well.
2016-02-28 18:44:35 +01:00
Alex Gaynor
3ac8970199 conditional fix 2016-01-02 14:29:35 -05:00
Alex Gaynor
e9b8a4d83d by order of the high commisioner on software, Python 2.6 is extremely illegal 2016-01-02 14:11:20 -05:00
Alex Gaynor
e0961df48b Include the OpenSSL version in the user agent 2016-01-02 14:06:41 -05:00
Xavier Fernandez
85e143c23d content_type is not used 2016-01-02 18:59:31 +01:00
Xavier Fernandez
30f4af0678 Move SETUPTOOLS_SHIM to its own file 2015-11-26 22:36:59 +01:00
Xavier Fernandez
3c00710438 Use a single setuptools shim
for all setup.py invocations
bdist_wheel will now use tokenize in Python 3 just like for install
fixes #2042
2015-11-26 22:36:59 +01:00
Erik Rose
622b430491 Typos and docstrings 2015-10-19 23:40:00 -04:00
Erik Rose
dcf39bfdf0 Add imports to make the pep8 checker happy about the dead _copy_dist_from_dir(). 2015-10-12 14:49:11 -04:00
Erik Rose
4c405a0ad3 Restore deleted _copy_dist_from_dir().
This reverts commit 62ac258e1e.

https://github.com/pypa/pip/pull/3176 is about to add the missing piece that makes this code useful (and not dead), so let's not delete it.
2015-10-12 14:37:03 -04:00
Erik Rose
be4e315c59 Rewrap args of unpack_http_url() to match the style in send(), above. 2015-10-10 22:44:13 -04:00
Erik Rose
6f828c351f Correct and clarify docs and comments. 2015-10-10 22:44:12 -04:00
Erik Rose
0c17248998 Pass PEP 8 checks. 2015-09-24 22:16:00 -04:00
Erik Rose
1e41f01823 Add checks against requirements-file-dwelling hashes for most kinds of packages. Close #1175.
* Add --require-hashes option. This is handy in deployment scripts to force application authors to hash their requirements. It is also a convenient way to get pip to show computed hashes for a virgin, unhashed requirements file. Eventually, additions to `pip freeze` should fill a superset of this use case.
  * In --require-hashes mode, at least one hash is required to match for each requirement.
  * Option-based requirements (--sha256=...) turn on --require-hashes mode implicitly.
  * Internet-derived URL-based hashes are "necessary but not sufficient": they do not satisfy --require-hashes mode when they match, but they are still used to guard against transmission errors.
  * Other URL-based requirements (#md5=...) are treated just like flag-based ones, except they don't turn on --require-hashes.
* Complain informatively, with the most devastating errors first so you don't chase your tail all day only to run up against a brick wall at the end. This also means we don't complain that a hash is missing, only for the user to find, after fixing it, that we have no idea how to even compute a hash for that type of requirement.
  * Complain about unpinned requirements when hash-checking mode is on, lest they cause the user surprise later.
  * Complain about missing hashes.
  * Complain about requirement types we don't know how to hash (like VCS ones and local dirs).
* Have InstallRequirement keep its original Link around (original_link) so we can differentiate between URL hashes from requirements files and ones downloaded from the (untrustworthy) internet.
* Remove test_download_hashes, which is obsolete. Similar coverage is provided in test_utils.TestHashes and the various hash cases in test_req.py.
2015-09-24 22:16:00 -04:00
Erik Rose
9211d6e313 Style tweaks 2015-09-23 17:39:32 -04:00
Erik Rose
62ac258e1e Delete dead _copy_dist_from_dir(). 2015-09-23 17:39:32 -04:00
Erik Rose
e058486c91 Fix some docstring typos. 2015-09-23 17:39:32 -04:00
Donald Stufft
8af4872ff6 Use the directory locking for the filecache 2015-05-20 14:21:11 -04:00
Donald Stufft
22e059556d Add a warning that'll tell people when their Python doesn't support TLS 2015-05-06 18:48:04 -04:00
Robert Collins
eda3f0451d Issue #2723: Restore the use of git clones
6.1.1 and before use git clones when installing a git+ url. 7.0.0.dev
didn't temporarily because the internal flag for controlling whether
to do a clone or an export was tied into the behaviour for whether
something will be deleted or not - which is arguably different. Remove
the confounded behaviour and just unpack always, using the same marker
flag to delete directories as used for file and non-vcs urls.
2015-04-25 15:33:33 +12:00
Xavier Fernandez
33753fb887 Centralize archive extensions list 2015-04-07 10:41:03 +02:00
Marc Abramowitz
4e6d935eaf Speed up unpack_file_url
E.g.: `pip install /path/to/dir`

by building an sdist and then unpacking it instead of doing
`shutil.copytree`. `shutil.copytree` may copy files that aren't included
in the sdist, which means that:

1. If those files are large, a `pip install` could take much longer than
it should.

2. Folks that are using `python setup.py install` to test their package
are not fully testing it, because it may copy over files that wouldn't
be there if they built and sdist and installed that.

So this method building an sdist is both more accurate and faster.

Fixes https://github.com/pypa/pip/issues/2195
2015-03-13 15:03:01 -07:00
Donald Stufft
61123b770e Be explicit that -H is for sudo 2015-02-24 07:59:48 -05:00
Donald Stufft
0bc8aa5622 Style fixes for the latest flake8 2015-02-24 07:46:10 -05:00
Donald Stufft
c1c638bd88 Handle updates to flake8 2015-02-11 10:23:57 -05:00
Paul Moore
18748b3de6 Make pip.utils.rmtree retry in case antivirus etc holds a directory 2015-02-04 20:34:24 +00:00
Clark Boylan
fb0e8c8f70 Only check download hashes if download succeeds
In _download_url pip was checking the download hash in a finally block
so that it was always checked regardless of download success. This is
problematic when downloads fail in a way that will make the hash check
fail. For example, downloading zero bytes so that a zero byte file is
hashed. When this happens the hash mismatch is reported to the user and
not the underlying network issue that was run into.

Fix this by removing the try finally block completely so that early
errors are bubbled up and reported to users.

Fix issue 2332
2015-01-06 09:41:49 -08:00
Donald Stufft
adb7a3c83f Remove some other places we called os.geteuid() 2015-01-03 03:35:38 -05:00
Donald Stufft
1d29275ce0 Don't show the progress bar if the -q is being used 2015-01-02 23:52:40 -05:00
Donald Stufft
4f40530493 Warn if the cache/log directory is not owned by the current user 2014-12-30 19:49:08 -05:00
Donald Stufft
5e65df9b7b Revert "Speed up unpack_file_url" 2014-12-22 17:30:49 -05:00
Donald Stufft
d851bcf7d6 Use the --trusted-host argument to disable TLS verification as well 2014-12-20 17:27:11 -05:00
Donald Stufft
5bab65d14d Split up Secure vs Insecure for the requests HTTPAdapters 2014-12-20 17:16:04 -05:00
Davidovich
1689291381 Refactored PR to use url2pathname and pathname2url. 2014-12-18 10:51:57 -05:00
Marc Abramowitz
383de6d30e Display URL downloading from
instead of just filename when using index other than PyPI.

It's useful to distinguish between downloading from PyPI or from an
internal devpi server, for example. In the latter case, it is useful to
see the full URL, to know which index pip is downloading from.

E.g.:

Downloading from PyPI is unchanged:

    $ pip install --no-cache-dir --ignore-installed Jinja2
    ...
      Downloading Jinja2-2.7.3.tar.gz (378kB)

But downloading from a different server results in displaying the full
URL:

    $ pip install --no-cache-dir --ignore-installed -i http://mirror.picosecond.org/pypi/simple jinja2
    ...
      Downloading http://mirror.picosecond.org/pypi/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz (378kB)
2014-12-17 15:28:58 -08:00
Marc Abramowitz
aeb43ce9f8 Speed up unpack_file_url
by ignoring .tox, .git, .hg, .bzr, and .svn  when doing
`shutil.copytree` in unpack_file_url in pip/download.py.

Fixes: GH-2195
2014-12-16 09:23:25 -08:00
Donald Stufft
a47411b18a Also retry connections on 503 errors 2014-12-02 02:58:09 -05:00
Xavier Fernandez
b713e96df2 cleanup: use "with open()" to open files 2014-10-18 20:41:18 +02:00
Xavier Fernandez
030f16500a unpack_url: session only needed for unpack_http_url 2014-10-18 20:41:17 +02:00
Donald Stufft
74b3a741d1 Include a "simple" User-Agent string as well as the JSON
To facilitate detection of pip in scenarios where parsing JSON isn't
easy but simple string matching is, change the User-Agent to be of
the form "pip/{version} {json}" instead of just "{json}".

The contents of the JSON data has not changed.
2014-10-06 07:42:15 -04:00
Donald Stufft
ec91d8e421 Move from pip.compat.* to six.moves.* for urllib related stuff 2014-09-11 18:40:45 -04:00
Donald Stufft
796320abac Merge pull request #2024 from kevinburke/requests-2.4.1-try3
Requests 2.4.1
2014-09-10 17:49:11 -04:00
Kevin Burke
e77c0c573c kill ChunkedEncodingError 2014-09-10 12:42:23 -07:00
Kevin Burke
53eab2357e make it pass 2014-09-10 12:38:35 -07:00
Donald Stufft
767d11e49c Switch to using the stdlib logger instead of pip.log 2014-09-10 09:36:09 -04:00
Donald Stufft
6cbc08dfd1 Switch to a JSON user-agent with more information 2014-09-09 21:35:25 -04:00
Xavier Fernandez
3b3c20983f pip.download: refactor and try to clarify
add _check_download_dir and _download_http_url to ease the understanding
of unpack_http_url and unpack_file_url functions
2014-08-27 22:08:27 +02:00
Xavier Fernandez
4f249fadb0 pip.download: add docstring and log 2014-08-27 22:08:27 +02:00