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

271 commits

Author SHA1 Message Date
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
Matthew Iversen
90762719a2 Use pip-test-package instead of virtualenv 2014-04-16 13:27:00 +10:00
Donald Stufft
5a76a47d3b Fix code to handle the latest flake8 2014-03-26 18:24:19 -04:00
Marc Abramowitz
37bed2011d test_install_editable_uninstalls_existing: Remove comment about
expect_error=True
2014-03-02 10:24:03 -08:00
Marc Abramowitz
3e0d7270a9 Add test_install_editable_uninstalls_existing 2014-03-02 04:31:05 -08: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
Donald Stufft
9f027337a8 Use Flake8 on the test of pip's Python files 2014-01-28 19:47:58 -05:00
Donald Stufft
eeea3b73aa Work around python 2.6 not having `python -m` 2014-01-07 09:03:43 -05:00
Donald Stufft
f934b77d61 Have a nice error when setuptools is not available 2014-01-07 08:36:04 -05:00
Ben Darnell
d84b4d2f46 Respect explicit encoding declarations in setup.py files.
In Python 2, the exec statement handles encoding for us, but in
Python 3 the encoding must be specified when opening the file
(if it's not specified it uses the system locale encoding, so
previously this would work only if your locale environment variables
specified the same encoding as the setup.py file).

On Python 3.2+ the tokenize.open function is available to interpret
the encoding declaration; fixing this for python 3.0 and 3.1 is more
difficult.
2013-12-20 01:29:20 -05:00
Donald Stufft
7ec49dc2fb Enable --[no-]compile which will compile or not compile pyc files
* Enables compilation for Wheel files
* Adds an easy command line for distutils/setuptools compilation
  options
2013-11-21 23:19:15 -05:00
Michael Williamson
048c9763a8 Add failing test case for installing when there are symlinks to directories 2013-11-09 23:57:34 +00:00
Donald Stufft
39b2aaf729 Fix the test which is still looking for the by typo 2013-10-30 08:19:10 -04:00
Donald Stufft
616ce39061 Rename --allow-insecure to --allow-unverified 2013-10-26 23:47:57 -04:00
Donald Stufft
487925ea3f Isolate the tests from the shared data directory 2013-08-27 06:49:35 -04:00
Donald Stufft
f9a3b97b41 Explicitly pass around a directory for tests.lib.local_repos 2013-08-27 06:47:25 -04:00
Donald Stufft
0c42245f21 Replace explicit calls to reset_env() with the script fixture 2013-08-27 06:47:23 -04:00
Donald Stufft
9894c8baac Refactor tests.lib
* Move virtualenv creation out of TestPipEnvironment
* Remove global state and force explicit use of TestPipEnvironment
  instances
* Remove "backup" virtualenv copying and instead create new
  virtual environments each time.
* Remove the monkeypatched "PyPICache" functionality
* Remove things that were not being used anymore and were dead
  weight
* Remove sitecustomize support which was primarily used to
  monkeypatch the "PyPICache" but was used in one or two other
  tests.
2013-08-21 22:40:16 -04:00
Donald Stufft
da0bc4b1d1 Switch to using py.test as the test runner instead of nose
* Better output with the bare asserts we use throughout the tests
* Function fixtures are pretty nice, especially as a way to
  start a background server or create an isolated virtualenv
2013-08-21 10:19:58 -04:00
Donald Stufft
85cb4167c8 Merge pull request #1055 from pypa/default-externals-to-off
Default to disallowing external and insecurely hosted files
2013-07-14 11:07:53 -07:00
Donald Stufft
dfe5a67f41 Fix tests with the new defaults 2013-07-14 13:26:33 -04:00
Paul Nasrat
76a74e549c Fix functional test. 2013-07-14 10:32:36 -04:00
Marcus Smith
a4f178bf15 remove old test that mistakenly resurfaced during merging 2013-06-19 17:08:32 -07:00
Marcus Smith
3e460e6946 test merge fixes 2013-06-19 17:08:32 -07:00
Marcus Smith
81639adbdf revert distribute skip in py3 (commit fe09baa1a2) 2013-06-19 17:08:32 -07:00
Marcus Smith
28298c413d more functional/unit tests restructure 2013-05-29 13:41:13 -07:00
Renamed from tests/functional/test_basic.py (Browse further)