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

134 commits

Author SHA1 Message Date
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
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