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

175 commits

Author SHA1 Message Date
Pradyun Gedam 8ed4ac1fe6
Another round of https updates (#4870) 2017-11-21 00:53:22 +05:30
Pradyun Gedam 01d97e71f0
Merge branch 'master' into cache/ephem-wheel-cache 2017-11-17 12:32:40 +05:30
Mathieu Bridon 62875be050 Record installed files in a deterministic order
Installed files are recorded by Pip in the order the underlying tool
(Distutils, Setuptools, ...) recorded them.

Unfortunately, at least Setuptools doesn't record them in a
deterministic order in the case of a directory being installed, as it
uses os.walk to find the list of files.

We could fix all those underlying tools to record their files in a
deterministic order in all situations. But fixing it once here in Pip
for all tools is certainly simpler and more future-proof.

This makes the installation more reproducible, and therefore more
verifiable.
2017-10-26 22:29:19 +02:00
Pradyun Gedam 1c6a450643
Merge branch 'master' of github.com:pypa/pip into cache/ephem-wheel-cache 2017-10-20 13:51:22 +05:30
Benoit Pierre 961737ab98 Fix integration tests on Windows (#4769) 2017-10-06 20:51:42 +01:00
Pradyun S. Gedam 16cda3069d Cleanup and rename test 2017-10-04 18:55:04 +05:30
Pradyun S. Gedam 901f52976a Fix test that broke in the merge 2017-10-04 18:53:55 +05:30
Pradyun S. Gedam ebf06ceb9d Merge master 2017-10-04 16:58:31 +05:30
Benoit Pierre d778fc330e Small tests related cleanups (#4703)
* fix test not using temporary directory
* avoid creating a `cache_dir` directory in the source tree
* drop `data` fixture from tests that don't use it

* tests: fix pytest warning
2017-10-02 18:33:52 +01:00
Pradyun Gedam fc7ca26489 Warn user when installing scripts outside PATH (#4553) 2017-10-02 17:54:37 +01:00
Donald Stufft 95bcf8c5f6 Move all internal APIs to pip._internal 2017-08-31 14:53:00 -04:00
Xavier Fernandez 1c7876fa49 Fix test_install_no_binary_disables_building_wheels
The only files present in the cache were http cache files from the
pip install wheel command.
2017-07-21 18:08:53 +02:00
Xavier Fernandez b709b1ef4a Add a common_wheels fixtures providing wheel & setuptools wheels 2017-07-21 18:08:53 +02:00
Thomas Kluyver 73440ede23 Update another install output test 2017-07-05 20:06:11 -04:00
Thomas Kluyver ad242d179d Update test of install output 2017-07-05 20:06:11 -04:00
Pradyun S. Gedam 21be153044 Display where pip is looking for packages (#4483)
Display where PackageFinder is looking for packages
2017-06-26 21:45:47 +01:00
Pradyun S. Gedam 9923c1ad7e Sort imports and minor Flake8 changes (#4520)
* Run isort on the codebase

Command: isort --recursive --skip __main__.py --skip _vendor -o pip._vendor -sd THIRDPARTY -m 5 -p pip -p tests ./pip ./tests

* 📰
2017-06-13 14:17:00 +02:00
Thomas Kluyver 20955812bf Merge branch 'master' into pep518 2017-05-19 11:04:32 +01:00
Pradyun S. Gedam 1832569530 Sort all imports 2017-05-16 15:47:47 +05:30
Thomas Kluyver aee5b6c984 Download packages to path, not to file:/// URL 2017-05-13 22:41:15 +01:00
Thomas Kluyver 2b2bdd1567 Download setuptools, wheel during tests
Rather than storing wheels in the test data directory
2017-05-13 19:51:38 +01:00
Brandon L. Reiss 1902760220 Fix egg= param in relative path tests
Also, reduce the number of test cases because these tests take too long.

The issue is that the setup and teardown of the test environment takes a
long time, and in order to reuse the same test environment, we must
perform install/uninstall cycles to test different URL and path formats.

A better approach might be to generate `FSPkg` using a function that
writes the `setup.py` and `__init__.py` files to a new directory. The
test packages would be easy to generate and save the uninstall time.

For now, we reduce the number of URL/path formats tested, since the
previous test coverage was even more limited.
2017-04-06 09:49:57 -04:00
Brandon L. Reiss c932706bbe Split relative paths tests to avoid timeout
Tests are timing out and also not following requirements/install test
factorization. Split to conform to test organization and to prevent
test timeout.
2017-04-05 18:38:26 -04:00
Brandon L. Reiss 97667d55f1 Fix from PR comments.
Responding to comments from @xavfernandez.
2017-04-05 12:33:48 -04:00
Brandon L. Reiss f4f67ea5d2 Add install relative path test. 2017-04-05 11:58:21 -04:00
Xavier Fernandez 49f259814f tests: addapt test_install_quiet
-qqq is now needed to hide warnings
2017-03-26 17:39:32 +02:00
Donald Stufft 6b54145783 Deprecate support for Python 3.3 2017-03-22 19:22:56 -04:00
Donald Stufft e6bfa12403 Remove the deprecated --download option to install 2017-03-20 10:49:56 -04:00
Donald Stufft bb48371714 Removed the deprecated `--egg` flag 2017-03-19 20:31:23 -04:00
Donald Stufft ceb7feed75 Update tests for the removal of Python 2.6 2017-03-18 14:52:14 -04:00
Xavier Fernandez 5b7060a20d Deprecate the _strip_postfix function (#4174)
It only happens for editable-non-file URLs and is an undocumented
behavior.
2017-02-13 10:02:20 +01:00
Xavier Fernandez 6ec5597930 Add support for PEP 508 @ url syntax (#4175)
* Add support for PEP 508 @ url syntax

* Add test for install_requires

* Forbid dependencies direct url
2017-02-05 12:22:36 +01:00
Nikhil Benesch 20326d8b24 Failing exit status when no requirements specified (#4210)
* add failing tests for #2720

* fix #2720: exit status when no requirements specified

* Don't fail when blank requirements files specified
2017-01-06 23:21:46 +01:00
Xavier Fernandez 4716962112 Improve tests
- improve two tests to make them network-less
- add a bunch of pytest.mark
2016-12-04 21:54:50 +01:00
Xavier Fernandez 8f171cd212 Fix environment markers evaluation - issue #3829 (#4051) 2016-11-02 08:28:17 -04:00
Xavier Fernandez 05c2d21f26 Add tests for python_requires
and cleanup when install is aborted
2016-10-27 18:43:59 +02:00
Donald Stufft 403e398330 Deprecate --egg (#3956) 2016-09-07 16:43:58 -04:00
Xavier Fernandez 65a82a2eb0 Always check_if_exists for editable
But only when pip has collected the editable package's metadata.

closes #1548
2016-08-05 22:42:22 +02:00
Xavier Fernandez 73fc56e613 Merge branch 'pr/1552' into check_if_exists_editable 2016-08-05 22:11:13 +02:00
Jakub Wilk 6dc28c1b31 Fix typos 2016-06-10 21:29:43 +02:00
Xavier Fernandez 91afd80a39 Fix a bunch of other tests
Add a --no-index to avoid network calls
2016-05-19 15:31:46 +02:00
Ian Wienand ec08a590d8 Root logger should use debug level for "--log" (#3586)
We want the root logger to output debug level logs when we have
specified "--log".  The log-file handler then sends this to our file,
and the other handlers (console) filter out at their appropriate
level.

This restores the intended behaviour of "--log" argument, which is
supposed to output verbose logs to a file always.

A test-case is added

Closes: #3351
2016-05-10 19:05:42 -04:00
Xavier Fernandez 01cd191402 Merge pull request #3505 from njsmith/fix-verbose-subprocess-output
Fix display of subprocess output when --verbose is given
2016-02-24 22:42:23 +01:00
Nathaniel J. Smith 113394250e Fix display of subprocess output when --verbose is given
Closes #3486
2016-02-23 15:13:55 -08:00
Nathaniel J. Smith af675e7797 Make install --quiet really quiet
Commit 5bb989993 added some code for hiding/showing the cursor when
running on the terminal, but accidentally made it so that it always
printed the invisible control codes, even when not on a tty or when
--quiet was specified. This turns out to be surprisingly bad (e.g. it
breaks the official docker python builds). So, let's not do that.

Fixes gh-3418
2016-02-01 14:59:06 -08:00
Xavier Fernandez 24dc9b6361 Merge pull request #3372 from kaustavha/kaustavha/fix/double-reqs
fix(pip/req/req_set): Dont err on double reqs of the same spec
2016-01-25 23:48:22 +01:00
Donald Stufft 3172b4e7d6 This test doesn't actually work in practice :( 2016-01-21 09:08:36 -05:00
Robert Collins 7b2fbb069a Stop erroring on installs of argparse and wsgiref. 2016-01-21 13:49:49 +13:00
kaustav haldar fbfa7fbcfe fix(pip/req/req_set): If double requirements exist which have the same specs, dont raise a double requirement given error 2016-01-19 22:25:25 -08:00
Xavier Fernandez d1136dda3e Add support for .xz files (with python >=3.3)
Closes #722
2016-01-14 22:39:45 +01:00
Xavier Fernandez 21fb8a28f0 Dont raise on #egg metadata mismatch, just warn
Since pip 7, via pip freeze, is producing such mismatching #egg
fragment, forbidding them in pip 8 would be too strongly
backward-incompatible.
It is a partial rollback of 1a012bb6.
2016-01-14 00:30:02 +01:00
Donald Stufft 2202f868f8 Adjust the tests to be more forgiving of extra stderr output 2016-01-01 22:20:14 -05:00
Donald Stufft 15a06418b5 PyPI no longer supports external files so this test doesn't make sense 2016-01-01 14:38:28 -05:00
Marcus Smith ca47dc9949 Merge pull request #3252 from domenkozar/install/prefix
Support pip install --prefix
2015-11-26 09:30:20 -08:00
Domen Kožar b4bb2eee14 Support also pip install -e --prefix 2015-11-24 10:01:46 +01:00
Domen Kožar 7270d272f4 Make sure --user and --prefix install flags conflict 2015-11-22 19:23:22 +01:00
Donald Stufft f39bc756e5 Merge branch 'develop' into hashes2 2015-11-06 18:46:09 -05:00
Donald Stufft 0e240d7dde Force the --python-tag when autobuilding wheels
A lot of existing tarballs will successfully build a wheel, but the
wheel will be implicitly broken because they will have dynamically
adjusted the install_requires inside of their setup.py. Typically
this is done for things like Python version, implementation, or what
OS this is being installed on. We don't consider cache directories
to be OS agnostic but we do consider them to be Python version and
implementation agnostic. To solve this, we'll force the cached
wheel to use a more specific Python tag that includes the major
version and the implementation.
2015-11-04 08:52:28 -05:00
Xavier Fernandez 0cc9d733bf Fix traceback.format_exc call
format_exc takes only one argument, limit which should be an integer.
python 2 seems more lenient than python 3 on that point.

mistake introduced in commit 3148b967a
2015-10-24 00:46:44 +02:00
Xavier Fernandez 89a27cd740 Special-case based on exception message 2015-10-22 23:15:02 +02:00
Xavier Fernandez 8cbb8af466 Report import setuptools error to the user
closes #2931
2015-10-19 16:43:01 +02: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 1a012bb63b Abort installation on metadata mismatch
If setup.py egg_info produces metadata for a different project name than
self.req.project_name, abort the installation.
Fixes #3143
2015-10-01 23:40:27 +02:00
Paul Moore 908d07734c Merge pull request #3047 from tgs/clean_wheel_build_dir
Clean build dir if bdist_wheel fails
2015-09-29 09:19:39 +01:00
Erik Rose 0c17248998 Pass PEP 8 checks. 2015-09-24 22:16:00 -04:00
Erik Rose 11dbb92440 Switch from --sha256 etc. to a single option: --hash.
Everybody seems to favor this. Spelled -H, it's still pretty short. And it is less unusual programmatically.
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
Mathew Jennings 417f79d8b8 Add pip download command and deprecate pip install --download.
`pip download` has the same functionality as `pip install --download`,
and the behavior of `pip install --download` is preserved with a deprecation
warning.  `pip install --download` will be removed in pip version 10.
2015-09-13 17:41:00 -04:00
Thomas Smith 2bbb3be1ff Failing test: should clean up failed wheel build
Test for PR #3047
2015-09-09 15:16:51 -04:00
Donald Stufft 6afc718307 Remove items slated for removal in pip 8.0 2015-09-03 10:55:11 -04:00
Donald Stufft 0f5d4286a5 Deprecate and Noop the PEP 438 functionality due to PEP 470 2015-09-02 23:47:05 -04:00
Robert Collins 582af6e684 Issue #2677: Disable wheels for setup.py options.
Using --install-options, --build-options, --global-options changes
the way that setup.py behaves, and isn't honoured by the wheel code.
The new wheel autobuilding code made this very obvious - disable
the use of wheels when these options are supplied.
2015-04-24 16:14:48 +12:00
Robert Collins 6aec23cafe Issue #2675: Granular control over wheels/sdists
With wheel autobuilding in place a release blocker is some granular
way to opt-out of wheels for known-bad packages. This patch introduces
two new options: --no-binary and --only-binary to control what
archives we are willing to use on both a global and per-package basis.

This also closes #2084
2015-04-24 08:52:48 +12:00
Robert Collins 08acb6670d Issue #2140: Build wheels automatically
Building wheels before installing elminates a cause of broken environments -
where install fails after we've already installed one or more packages.

If a package fails to wheel, we run setup.py install as normally.
2015-04-13 18:33:07 +12:00
Robert Collins 35ec67ab08 Add functional test that we can install non-wheelable sdists.
This is a preventative against breaking this as we add automatic
wheelisation.
2015-04-09 14:09:27 +12:00
Donald Stufft b7309c6bcc Remove the items deprecated for removal in 7.0 2015-04-07 04:20:51 -04:00
Donald Stufft a88bc0de73 Send log messages >= logging.WARNING to stderr 2015-04-06 23:11:16 -04:00
Marcus Smith 16108e99ad have the topo sort test use consistent dist type 2015-04-01 16:37:00 -07:00
Robert Collins 17352765f0 Issue #2478 - topological install order.
This is needed for setup-requires, since without it its possible
to cause installation to fail in sort-circuit scenarios such as
the added functional test case demonstrates.
2015-04-01 12:33:17 +13:00
Marcus Smith 47963aec7f Merge pull request #2577 from msabramo/test_install_less_deps_2
Less network deps in test_install
2015-03-23 19:46:26 -07:00
Marc Abramowitz 291bb12d07 test_install_package_with_target: No network
and also fix intermittent failures reported in
https://github.com/pypa/pip/issues/2580
2015-03-22 23:09:38 -07:00
Marc Abramowitz f6dda5aa80 Less network deps in test_install 2015-03-19 03:54:09 -07:00
Robert Collins 31534feba5 Fix up references to tests/packages to tests/data/packages. 2015-03-18 14:25:41 +13:00
Marc Abramowitz 987ce2b3b1 test_install: Less deps on external stuff
so that tests are faster and less likely to fail intermittently,
especially on Travis CI, where the networking is flakey.
2015-03-16 17:50:16 -07:00
Donald Stufft 9bd89d6d69 Merge pull request #2540 from Lukasa/requests26
Upgrade requests to 2.6.0.
2015-03-15 12:05:48 -04:00
Cory Benfield 06ea5fc05d Create pyversion_tuple 2015-03-15 15:32:47 +00:00
Cory Benfield a792ad3a7a Expect urllib3 platform warnings. 2015-03-15 14:56:08 +00:00
Xavier Fernandez 9dd1852c16 remove DistributionNotFound when no version is found
- and rely on if not applicable_versions test instead
- fixes #2502
- rephrase the DistributionNotFound error message to fix other tests
2015-03-15 12:07:36 +01: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
Matej Stuchlik c5024dc851 Mark tests requiring Internet access 2015-01-15 00:53:15 +01:00
Donald Stufft 5f414a69c6 Don't return cached output for InstallRequirement().installed_version 2014-12-23 07:39:13 -05:00
Donald Stufft 6f64d3e6e2 Implement PEP 440 2014-12-13 13:50:21 -05:00
Donald Stufft 5f0692b40a Fix for latest setuptools 2014-12-13 12:38:55 -05:00
Paul Moore f6b0665553 Merge pull request #2007 from jonparrott/develop
Fixing issues with install's --target option.
2014-09-11 14:04:26 +01:00
Donald Stufft 767d11e49c Switch to using the stdlib logger instead of pip.log 2014-09-10 09:36:09 -04:00
Jon Wayne Parrott ecb3049b8d Covering case of single-module packages.
Behavior is now to overwrite files or folders if --upgrade is specified, however, links will not be overwritten.
2014-08-31 12:11:27 -04:00
Jon Wayne Parrott 12ff251d2d Fixing pep8 errors 2014-08-30 21:25:03 -04:00
Jon Wayne Parrott acf8634e8f Fixing issues with install's --target option.
1. Check for the existence of a directory before copying from temporary directory to final target. If it exists, warn the user.
 2. If the user specifies the --upgrade option and the directory exists, delete it and continue with installation.
 3. Adding tests for above cases.

This resolves #1489, #1710 completely and parts of #1833.
2014-08-30 20:21:08 -04:00
Donald Stufft e3873b1be8 Merge pull request #1704 from jamezpolley/develop
If at first you can't stat the index file, try again
2014-05-03 07:46:29 -04:00
James Polley 58097b64c4 Add tests (and data required for tests) for new code that enables retry
if we can't stat a file while using a file:/// index-url.
2014-04-30 12:03:55 +10:00