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

126 commits

Author SHA1 Message Date
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
Xavier Fernandez 55eee4bacd Align unpack_http_url to unpack_file_url 2014-08-27 22:08:26 +02:00
Xavier Fernandez a4a8d73bcc Move unpack_url to pip.download
This puts all unpack functions in the same place.
Cherrypicked from a commit of qwcode
2014-08-27 22:08:26 +02:00
Antonio Alvarado Hernandez 0dedf2b6f5 Passing headers per-request in PipXmlrpcTransport
* Changed `PipXmlrpcTransport` to pass headers at request scope
* Added summary line to the changelog
2014-07-04 00:25:21 +02:00
Antonio Alvarado Hernandez 57f2d47b84 Proposed fix to #1180 (and maybe #932 & #1104)
This is a rebased final version of a proposed solution to fix
issues #932, #1104 & #1180. Following changes have been done:

* Implemented a new class `PipXmlrpcTransport` using a
  contained `PipSession` object.

* Modified the `pip/commands/search.py` to make use of the
  `PipXmlrpcTransport` class.

* Properly initialized options for testing `SearchCommand`:
  - Changed `options_mock` to an `options` object built from
    `parse_args`, to properly initialize default options.
2014-06-28 00:26:40 +02:00
Matthew Iversen b7770c502a Remove unnecessary imports, move some to six 2014-06-07 04:21:51 +10:00
Chris Brinker 374ea8ba2e Some basic auth usernames contain @ symbols, example: email addresses. Make sure we only rsplit just to be sure. 2014-05-14 14:14:19 +10:00
Matthew Iversen dcb0ee0702 Move backwardcompat package to compat module 2014-05-14 13:10:06 +10:00
Donald Stufft 52ca02608e Use CacheControl instead of custom cache code
* Deprecates the --download-cache option & removes the download
  cache code.
* Removes the in memory page cache on the index
* Uses CacheControl to cache all cacheable HTTP requests to the
  filesystem.
  * Properly handles CacheControl headers for unconditional
    caching.
  * Will use ETag and Last-Modified headers to attempt to do a
    conditional HTTP request to speed up cache misses and turn
    them into cache hits.
  * Removes some concurrency unsafe code in the download cache
    accesses.
  * Uses a Cache-Control request header to limit the maximum
    length of time a cache is valid for.
* Adds pip.appdirs to handle platform specific application
  directories such as cache, config, data, etc.
2014-05-09 18:28:20 -04:00
Donald Stufft f79ca70c66 Remove the bundle functionality from pip 2014-05-08 16:09:23 -04:00
Donald Stufft 7037443975 Require an already created session to be passed into APIs 2014-05-06 22:37:46 -04:00
Donald Stufft 0c1c5d35c6 Merge pull request #1792 from dstufft/cleanup-file-url
requests can handle file:// urls without a hostname now
2014-05-06 16:38:13 -04:00
Donald Stufft bab487f24f LocalFSResponse() is no longer required
requests can now handle a Response().raw that does not have a
_original_response property.
2014-05-06 13:09:59 -04:00
Donald Stufft 399a4276ff requests can handle file:// urls without a hostname now 2014-05-06 13:05:24 -04:00
James Polley 8304a8be38 If at first you can't stat the index file, try again
If Pip is using an index url that starts with http:// or https://, and
it gets a 404, it does Magic(TM) to figure out what the real name of the
package is. The code looks as though it's intended to do this for
file:// urls as well - but it doesn't, because nothing catches the
OSError that gets raised when the first stat fails.

In order to let this failure be handled and let the usual logic kick in,
set the response status to 404 and let the error bubble up.
2014-04-30 12:03:55 +10:00
Donald Stufft 190824b949 Document why we use decode_response=False 2014-03-27 11:34:51 -04:00
Donald Stufft 22c562429a Use Accept-Encoding: identity when requesting files 2014-03-27 11:34:51 -04:00
Donald Stufft 5a76a47d3b Fix code to handle the latest flake8 2014-03-26 18:24:19 -04:00
Donald Stufft c85150a500 Merge pull request #1444 from novel/retries
Introduce 'retry' option
2014-03-06 22:10:34 -05:00
Daniele Procida 68cacfb71d fixes #1615 2014-03-05 18:17:43 -05:00
Donald Stufft 95035fc5c4 Turn on everything in flake8
flake8 ignores some errors by default, these ignored by defaults
change sometimes. This will make things stabler by selecting
everything.
2014-02-24 16:52:23 -05:00
Roman Bogorodskiy f29dd1ad32 Introduce 'retry' option
Add a 'retry' option which allows to configure how many
retries pip should make before giving up on HTTP request.

When the retries count is specified by user, its value is
passed to HTTPAdapter from requests which handles all
the underlying operations.
2014-02-04 00:37:05 +04:00
Marcus Smith eb7a31e019 when file urls have hash fragments, check it 2014-02-01 14:04:58 -08:00
Marcus Smith e41bf0230e 'pip wheel' should download wheels, when it finds them 2014-02-01 11:41:55 -08:00
Donald Stufft 2743768b7b Fix the style of the code base to better match pep8 2014-01-27 14:11:29 -05:00
Donald Stufft 30204be35b Remove uses of sys.exc_info()[1]
Using sys.exc_info()[1] is a hack that was used to use a shared
source approach to Python 3.x support that also included versions
of Python that didn't include the except ... as exc: construction.
Pip no longer supports any of these versions of Python so we can
remove it.
2014-01-27 08:02:10 -05:00