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

38 commits

Author SHA1 Message Date
Stéphane Bidoul a1622ad0a5 detect editable distribution by the presence of .egg-link 2015-12-04 14:40:24 +01:00
Stéphane Bidoul 23d86c90b6 add git support for controls_location() 2015-12-04 14:40:00 +01:00
Donald Stufft f39bc756e5 Merge branch 'develop' into hashes2 2015-11-06 18:46:09 -05:00
Donald Stufft 4bdd58c29a Merge pull request #3224 from njsmith/install-spinner-PoC
Display spinner during long setup.py calls
2015-11-06 12:21:44 -05:00
Nathaniel J. Smith 5bb9899938 Display spinner during long setup.py calls
One of the downsides of pip's new hiding of build chatter is that for
packages that take a very long time to build (e.g. scipy) the user gets
no indication that anything is happening for a very long time (e.g. tens
of minutes), and is likely to get frustrated and hit Control-C. This can
also create issues for automated systems that kill jobs that don't
produce occasional output (e.g. Travis-CI).

This commit implements an idea discussed here:

  https://github.com/pypa/pip/issues/2732#issuecomment-153215371

where we put up a spinner that rotates whenever the underlying build
produces output. I tried it on scipy, and it the experience was quite
pleasant! It spun around, sometimes fast and sometimes slow, and then
there was one uncomfortable pause for ~1 minute while a very gnarly C++
file got compiled, but that's okay because it was actually providing
accurate feedback.

It looks like:
```
  Running setup.py install for scipy ... /
  Running setup.py install for scipy ... -
  Running setup.py install for scipy ... \
  Running setup.py install for scipy ... done
```
or if the command has non-zero return code, or an exception is raised,
you get:
```
  Running setup.py install for scipy ... /
  Running setup.py install for scipy ... -
  Running setup.py install for scipy ... \
  Running setup.py install for scipy ... error
```
2015-11-05 23:28:03 -08:00
Xavier Fernandez f1bf7515c2 pip.index: remove INSTALLED_VERSION
closes #703
2015-11-04 22:52:44 +01:00
Erik Rose be6dccb034 Factor up the idiom of reading chunks from a file until EOF. 2015-10-12 13:07:53 -04:00
Erik Rose 7a0a97c081 Merge 'develop' into 'hashing' to bring the latter up to date. 2015-10-08 13:37:19 -04:00
Xavier Fernandez fe28652e63 Merge pull request #3136 from rouge8/fix-py26-home-slash
Fix user directory expansion when HOME=/
2015-09-29 22:18:24 +02:00
Andy Freeland 73a439ea66 Add pip.compat.expanduser to workaround http://bugs.python.org/issue14768 2015-09-29 16:01:32 -04:00
Xavier Fernandez 070a7289a2 Fix split_leading_dir, no need to cast to str
closes #2729
2015-09-29 14:28:33 +02: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
Xavier Fernandez c73b1f9fd5 rename to canonicalize_name 2015-09-08 00:18:54 +02:00
Xavier Fernandez 2ff59d1cc0 Add canonical utils function 2015-09-06 19:20:14 +02:00
Xavier Fernandez 8c67bccb2c Remove now useless code
since a23a65cee4
2015-09-04 23:24:08 +02:00
Xavier Fernandez f8040ab13e Use stdlib os.path.relpath
instead of custom (and now useless) make_path_relative
2015-09-03 15:38:44 +02:00
Xavier Fernandez 0e8d5801b0 Compute pip version from its metadata
Move InstallRequirement.installed_version to a get_installed_version helper
Adapt test
2015-07-06 10:28:18 +02:00
Donald Stufft 56d5076ee2 Hide setup.py output unless using -v 2015-05-20 21:27:12 -04:00
Robert Collins 12e719db78 Create ensure_dir helper.
We had a very widely used pattern which can be factored out for a mild
saving in LOC, and a gain in clarity.
2015-04-07 08:55:52 -04:00
Xavier Fernandez 33753fb887 Centralize archive extensions list 2015-04-07 10:41:03 +02:00
Thomas Kluyver e1989f0d1a Add test for normalize_path()
And call abspath() when not following symlinks
2015-03-18 16:02:30 -07:00
Thomas Kluyver 7e9a42dcda Add resolve_symlinks arg to normalize_path() 2015-03-18 15:38:12 -07:00
Paul Moore 584b2d0f82 Remove find_command - let subprocess.Popen search PATH for the VCS command to run 2015-03-11 11:37:39 +00:00
Marc Abramowitz c1d21e35a3 install: Less output on success; once on failure
This fixes 2 aspects of `pip install output`:

1. When `pip install` succeeds, it's still printing a lot of output from
   the package's setup.py. The average consumer of Python packages, when
   they do `pip install lxml`, probably doesn't care to see a bunch of
   output about:

   - copying files to a `build` directory
   - installing and running Cython
   - compiling C code

   This is noise to most when the `pip install` succeeds. It's useful to
   see all the output when the install fails, which is the subject of #2
   below. On success, the output is now very clean with 5 short lines:

       $ pip install lxml
       Collecting lxml
         Using cached lxml-3.4.2.tar.gz
       Installing collected packages: lxml
         Running setup.py install for lxml
       Successfully installed lxml-3.4.2

2. When there's an error from `pip install`, it's annoying to have to
   scroll through 2 different copies of the failure output (especially when
   one is filtered and one is unfiltered so one might have stuff that the
   other doesn't). This makes it not print the filtered version so that
   there is just the unfiltered version and nothing is repeated.

       $ pip install ~/dev/git-repos/lxml
       Processing /Users/marca/dev/git-repos/lxml
       Installing collected packages: lxml
         Running setup.py install for lxml
           Complete output from command ...
           cc -c /var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.c -o var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.o
           /var/folders/gw/w0clrs515zx9x_55zgtpv4mm0000gp/T/xmlCheckVersion4tBaVV.c:1:10: fatal error: 'libxml/xmlversion.h' file not found
           #include "libxml/xmlversion.h"
                    ^
           1 error generated.
           ----------------------------------------
           Command "/Users/marca/python/virtualenvs/pip/bin/python -c ...

   None of the lines above are repeated.
2015-03-05 16:49:02 -08:00
Marc Abramowitz 3f6722c7f6 Eliminate blank lines from setup.py failure output
Fixes a long-time annoyance that setup.py failure output has a blank
line after every line -- e.g.:

    $ pip wheel ~/dev/git-repos/lxml
    Processing /Users/marca/dev/git-repos/lxml
      ...
      /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/libxml2 -Isrc/lxml/includes -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace

      In file included from src/lxml/lxml.etree.c:314:

      src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found

      #include "libxml/xmlversion.h"

               ^

      1 error generated.

      error: command '/usr/bin/clang' failed with exit status 1
      ...
2015-03-05 09:53:35 -08:00
Marc Abramowitz 1a2c3f117a Refactor wheel command check of required packages
- Move code into separate method - check_required_packages
- Use new import_or_raise function - mostly so we don't have to have
  hacks for flake8 and comments to explain said hacks
2015-02-24 06:49:04 -08: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
Donald Stufft 6f64d3e6e2 Implement PEP 440 2014-12-13 13:50:21 -05:00
Xavier Fernandez b713e96df2 cleanup: use "with open()" to open files 2014-10-18 20:41:18 +02:00
Paul Moore b0d173e435 Added unit tests for get_installed_distributions user_only 2014-10-15 23:03:44 +01:00
Paul Moore 56496f6526 Add --user options to pip list and pip freeze 2014-10-14 16:00:52 +01:00
Matt Robenolt 334af19e7c Better ignore syntaxerror stack traces in wheels
This already got stripped just fine for non-wheel installs, but for
wheels, it only stripped the lined where `SyntaxError` was present
leaving the rest of the stacktrace.
2014-10-01 00:12:07 -07:00
Buck Golemon 32557a6474 just the @cached_property bit 2014-09-22 10:45:14 -07:00
Donald Stufft c3df28c774 Fix for Python 3.x, Refactor, and small changes 2014-09-18 07:44:02 -04:00
Richard Jones 500a987ee4 Implement a pip self-check with to determine when it's out of date.
Initial work cribbed from PR 1214.
2014-09-18 17:31:57 +10:00
Donald Stufft 767d11e49c Switch to using the stdlib logger instead of pip.log 2014-09-10 09:36:09 -04:00
Renamed from pip/util.py (Browse further)