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

111 commits

Author SHA1 Message Date
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
Donald Stufft e32b4c6704 Return the native string type 2014-01-11 20:27:14 -05:00
Donald Stufft aa6136014f Use the raw stream to prevent decoding the response 2014-01-07 11:57:25 -05:00
Marcus Smith 56d3a48de1 Merge pull request #1330 from qwcode/path_to_url
a single `path_to_url` function with tests
2013-11-20 16:09:57 -08:00
Marcus Smith 73b8692d86 a single path_to_url function with tests 2013-11-18 22:12:41 -08:00
Steven Myint f579c178bc Keep symlinks as symlinks when installing
Without this, "pip install" crashes when encountering symlinks that
point to external paths. The culprit is "shutil.copytree()", which
throws an error in such cases if the "symlinks" parameter is not set to
"True".

This fixes #1006.
2013-11-10 00:04:27 +00:00
Donald Stufft 814514e1bd Rename pip.vendor.* to pip._vendor.* to ensure it's obviously private 2013-10-22 21:32:25 -04:00
Donald Stufft e34769861e Enable Basic Auth either inside of urls or by prompting 2013-09-24 23:32:03 -04:00
Donald Stufft 92c40c3e06 Ensure that we successfully utilize requests timeout functionality 2013-09-24 23:32:03 -04:00
Donald Stufft ff2854a855 Use requests instead of urllib2 2013-09-24 23:32:03 -04:00
Donald Stufft be0c47f7aa Merge remote-tracking branch 'skwash/develop' into develop
Conflicts:
	pip/download.py
2013-06-02 22:31:14 -04:00
Carl Meyer 9b92e4d786 Don't copy to cache when we've already got a cached copy. 2013-05-30 18:25:19 -06:00
Carl Meyer 4b55015c29 Fix guessing content-type for already-downloaded file. 2013-05-30 18:25:19 -06:00
Carl Meyer 55c766dacb Better interaction between already-downloaded and already-cached. 2013-05-30 17:00:10 -06:00
Carl Meyer b3a791223c Cached or already-downloaded files with bad hashes are ignored. 2013-05-30 17:00:10 -06:00
Carl Meyer 388d1b53a7 Refactor unpack_http_url. 2013-05-30 16:59:57 -06:00