Commit Graph

96 Commits

Author SHA1 Message Date
Devesh Kumar Singh 60f00b837a Upgrade flake8 to 3.8.1
Co-Authored-By: Anthony Sottile <asottile@umich.edu>
2020-05-18 21:58:26 +05:30
Jason R. Coombs 3511d3d493 Convert the remaining '%' formatters to '.format'. Fixes #6973. 2020-03-06 12:43:03 -05:00
Deepak Sharma b242c3979a String formatting updated 2020-01-23 18:09:59 +05:30
Chris Hunt e53d10db01 Remove unnecessary uninstall
Since a new temporary script path is used for each test, no need to do
uninstall.
2020-01-11 19:39:12 -05:00
Chris Hunt f89013daa4 Parametrize editable for relative install tests 2020-01-11 19:37:10 -05:00
Chris Hunt 2801de5825 Parametrize long relative install tests
This lets us make better use of parallelization and will let us remove
the unnecessary uninstallation from these individual tests.
2020-01-11 19:32:44 -05:00
Chris Hunt 7af9371176 Remove redundant expect_error=False in tests
This is the default, so there is no need to specify it explicitly.
2020-01-03 14:25:36 +01:00
Chris Hunt b8f626ace6 Deprecate install-location-related options in --install-option 2019-11-30 17:42:48 -05:00
Pradyun Gedam 8981895b5e
Skip all failing tests when using venv
Our isolation logic for venv isn't correct and that is causing these
tests to fail. The culprits for this are:

  tests/lib/venv.py::VirtualEnvironment.user_site_packages
  tests/lib/venv.py::VirtualEnvironment.sitecustomize

Both these together are supposed to create an environment to isolate the
tests. However, they were written for virtualenv and make assumptions
that are not true for environments created with venv. Until we can fix
VirtualEnvironment to properly isolate the test from the underlying test
environment when using venv, these tests will continue to fail.

This is blocking an important bugfix for users facing issues with since
pip is installing packages into `--user` when run in a venv, even when
`--user` isn't visible from that environment.

As a temporary band-aid for this problem, I'm skipping these tests to
unblock us from shipping the bugfix for the aforementioned issue.

The test isolation logic should be fixed to work for venv. Once such a
fix is made, this commit should be reverted.
2019-11-05 23:02:45 +05:30
Harsh Vardhan 0e6ac42c93 Add need_svn decorator for tests which require svn
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
2019-10-15 17:22:16 +05:30
Pradyun Gedam 37bc629551
Rename tests.lib.path.Path.{abspath -> resolve()} 2019-10-07 18:01:06 +05:30
Pradyun Gedam 7d72b3e034
Update uses of path subtraction to os.path.relpath 2019-10-07 12:38:22 +05:30
Chris Jerdonek 188ec6ff4e Don't pass "/trunk" when calling local_checkout() with svn. 2019-09-21 03:29:34 -07:00
Chris Jerdonek 9a765b8cab Change local_checkout() to accept tmpdir. 2019-09-13 21:41:32 -07:00
Chris Hunt 0a6b3cedae Remove unnecessary expect_error. 2019-08-10 22:39:57 -04:00
Pradyun Gedam 145a753cd3
Update tests for eagerly populated links 2019-07-29 20:31:52 +05:30
Pradyun Gedam 537b0fca12
Change isort multi_line_output to 3 2019-07-22 10:15:27 +05:30
Chris Hunt 39ac9ca351 Rename compatible functions in tests.lib.path.Path. 2019-07-02 18:48:44 -04:00
Chris Jerdonek 24688ee8e8 Revert "Require --no-use-pep517 if using editable mode with pyproject.toml."
This reverts commit 71f506e71e.
2019-04-26 20:19:05 -07:00
Chris Jerdonek 71f506e71e Require --no-use-pep517 if using editable mode with pyproject.toml. 2019-03-31 05:40:08 -07:00
Miro Hrončok 75c2201d5a Mark 3 tests as network tests
________________ test_constraints_local_editable_install_pep518 ________________
    ...
    ----------------------------- Captured stdout call -----------------------------
    Script result: python -m pip download setuptools wheel -d /tmp/pytest-of-mockbuild/pytest-0/test_constraints_local_editabl0/data/packages
      return code: 1
    -- stderr: --------------------
      Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fba7fdeb160>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fba7fdeb0b8>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
      Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fba7fdeb4e0>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
      Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fba7fdeb6d8>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
      Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fba7fdeb860>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
      Could not find a version that satisfies the requirement setuptools (from versions: )
    No matching distribution found for setuptools

    _____________ test_pep517_wheels_are_not_confused_with_other_files _____________
    ...
    -- stdout: --------------------
    Processing /tmp/pytest-of-mockbuild/pytest-0/test_pep517_wheels_are_not_con0/data/src/withpyproject
      Installing build dependencies: started
      Installing build dependencies: finished with status 'error'
      Complete output from command /tmp/pytest-of-mockbuild/pytest-0/test_pep517_wheels_are_not_con0/workspace/venv/bin/python /builddir/build/BUILDROOT/python-pip-19.0.2-1.fc30.x86_64/usr/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pytest-of-mockbuild/pytest-0/test_pep517_wheels_are_not_con0/workspace/tmp/pip-build-env-3un7dqu3/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel:
      Collecting setuptools
        Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb7cf5a8898>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
        Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb7cf5b9588>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
        Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb7cf5b9470>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
        Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb7cf5b9278>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
        Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7fb7cf5b9208>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/setuptools/
        Could not find a version that satisfies the requirement setuptools (from versions: )
      No matching distribution found for setuptools

    ________________________ test_upgrade_argparse_shadowed ________________________
    ...
    ----------------------------- Captured stdout call -----------------------------
    Script result: python -m pip install argparse==1.3
      return code: 1
    -- stderr: --------------------
      Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff07d6db240>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/argparse/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff07d6db358>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/argparse/
      Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff07d6db400>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/argparse/
      Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff07d6db518>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/argparse/
      Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff07d6c7710>: Failed to establish a new connection: [Errno -2] Name or service not known')': /simple/argparse/
      Could not find a version that satisfies the requirement argparse==1.3 (from versions: )
    No matching distribution found for argparse==1.3
2019-02-13 13:01:04 +01:00
Pradyun Gedam 7222cb8fdb
Remove --process-dependency-links and related support code 2019-01-02 17:27:06 +05:30
Florian Rathgeber 6278c6c371 Decorate tests using SVN with pytest.mark.svn (#5944) 2018-11-10 17:13:20 +05:30
Benoit Pierre add3801163 tests: rework tests virtual environment
- cleanup virtualenv creation code
- ensure all testing virtual environments use a recent version
  of setuptools / wheel, making it easier to switch to custom
  versions of those, as well as reducing network accesses
- reduce size of testing virtual environment, slightly speeding
  up the testsuite
2018-10-18 23:28:37 +02:00
Phil Pennock cb529e677b reduce new pylint complaints
Mostly indentation complaints, plus an unused test parameter, fixed.
Leaves one new pylint complaint, which is about a test function naming
issue which affects every test.
2018-03-20 17:32:22 -04:00
Phil Pennock 23cd8f6899 Keep install options in requirements.txt from leaking
The list of install options passed into the setup routine is mutable,
passed by reference, so adding items for "this package" to that list
mutates the options for all subsequent packages.

Isolate the lists before mutating them.

Includes a functional test, which has been confirmed to fail without
this fix.

Fixes #3763
Fixes #4453
Fixes #5089
2018-03-20 16:23:34 -04:00
Paul Moore 34cc364903
Merge pull request #4999 from xoviat/pep518-editable
Run setup.py develop inside of PEP 518 build environment
2018-03-02 08:40:17 +00:00
xoviat 76f62b7129 🎨 2018-03-01 12:41:32 -06:00
xoviat 9280d17873 Download setuptools and wheel to packages 2018-01-28 17:10:56 -06:00
xoviat 736cd67d9d Add regression test 2018-01-28 16:44:38 -06:00
Ed Morley 4b81388199 Use log level info when ignoring packages due to environment markers
The use of environment markers implies that the user expects the
packages to not be installed in some cases (eg depending on version
of Python), so the log output shouldn't be classed as a warning,
particularly since this results in it being sent to `stderr` rather
than `stdout`.

Fixes #4876.
2018-01-28 15:36:23 +00:00
Pradyun Gedam 353a13ddff
isort: Include trailing commas 2017-11-21 13:23:59 +05:30
Benoit Pierre 961737ab98 Fix integration tests on Windows (#4769) 2017-10-06 20:51:42 +01:00
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
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
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 61f89c5e80 Make pep8 happy again 2017-05-13 23:10:34 +01:00
Thomas Kluyver 2e865164ba Find build requirements in the tmp copy of test data folder 2017-05-13 23:05:11 +01:00
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
Donald Stufft 95b9541ed4 Remove the deprecated --(no-)use-wheel flags 2017-03-20 10:49:56 -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
Pradyun 8f9a48e806 Fix Tests for Travis CI (#4199)
* FIx Tests to pip paramiko

* Make the test completely local

It's easier to depend on a local package than to depend on a network based test.
2016-12-23 11:09:45 +01:00
Donald Stufft f1d0939d63 Revert "Normalize file URLs" (#4071) 2016-11-03 11:24:34 -04:00
Xavier Fernandez 8f171cd212 Fix environment markers evaluation - issue #3829 (#4051) 2016-11-02 08:28:17 -04:00