Commit Graph

84 Commits

Author SHA1 Message Date
Tzu-ping Chung da23209fbe Expect deprecation warning for build_dir in tests 2020-06-23 20:18:42 +08:00
Stéphane Bidoul acab2ee54e Deprecate --build-dir 2020-06-21 19:05:55 +02:00
Paul Moore e97b365529 Mark a few more tests as working under the new resolver 2020-06-10 13:08:37 +01:00
Stéphane Bidoul 2946038f25
Merge pull request #8366 from gutsytechster/add_helper_method_to_uninstall_and_wheel
Add helper methods for path lookups to test_{uninstall, wheel}.py
2020-06-09 22:20:26 +02:00
Tzu-ping Chung daf454bb3b Mark build dir tests as passing for new resolver
The new resolver uses UUID to allow parallel build directories, so this
error will no longer occur.
2020-06-04 23:26:19 +08:00
gutsytechster 51897fcb63 refactor(test_wheel.py): Add helper methods for path lookups 2020-05-30 23:44:43 +05:30
Paul Moore c2fa0dd997 Add a mark for tests that fail on the new resolver 2020-05-21 15:39:00 +01:00
Miro Hrončok eb070d2372 Avoid a test dependency on a C compiler, skip the test on Windows 2020-03-19 23:50:41 +01:00
Miro Hrončok 98aa09cf88 Prevent infinite recursion with pip wheel with $TMPDIR in $PWD
During a build of extension module within `pip wheel` the source directory is
recursively copied in a temporary directory.

See https://github.com/pypa/pip/issues/7555

When the temporary directory is inside the source directory
(for example by setting `TMPDIR=$PWD/tmp`) this caused an infinite recursion
that ended in:

    [Errno 36] File name too long

We prevent that buy never copying the target to the target in _copy_source_tree.

Fixes https://github.com/pypa/pip/issues/7872
2020-03-19 18:07:56 +01:00
Jason R. Coombs 6282a307dc 👹 Feed the hobgoblins (delint). 2020-03-06 12:43:10 -05:00
Jason R. Coombs 3511d3d493 Convert the remaining '%' formatters to '.format'. Fixes #6973. 2020-03-06 12:43:03 -05:00
Chris Hunt 98cd193727 Remove delete_marker_file writing in tests
Nothing checks for this file, so no need to write it.
2020-02-05 20:14:44 -05:00
Stéphane Bidoul (ACSONE) 1ee270a8d4
Check that the cache is writable in _main()
This avoid code duplication (for the wheel and http
cache) and repeated warnings.
2019-12-28 13:04:54 +01:00
Stéphane Bidoul (ACSONE) 865539bdad
Test that pip wheel succeeds when cache dir is not writeable 2019-12-28 13:04:40 +01:00
Stéphane Bidoul (ACSONE) 32cabbf716
Add test for pip wheel with non-absolute cache dir 2019-12-14 12:47:14 +01:00
Christopher Hunt d7eaede434
Revert "Add new option: pip wheel --save-wheel-names (#6377)" (#7420)
This reverts commit bcad1b1cb5, reversing
changes made to f86490317a.

As discussed, we should rethink the interface of this command output as
part of larger CLI usability review. In the interim, the same
functionality can be achieved using straightforward shell commands.
2019-12-13 07:57:05 +08:00
Stéphane Bidoul (ACSONE) ba60397dd4
Make pip wheel cache what it built
Just like pip install.
2019-11-03 22:08:42 +01:00
Patrik Kopkan 9a2181a087 Add new option: pip wheel --save-wheel-names 2019-09-25 13:39:34 +02:00
Xavier Fernandez 34092d3234 Move pip marker related constant & function in their own module
It didn't seem related with the rest of the locations module
2019-07-18 22:53:05 +02:00
Pradyun Gedam bc88399d07
Change Path.makedirs() -> Path.mkdir(parents=True) 2019-07-12 13:30:18 +05:30
Chris Hunt 39ac9ca351 Rename compatible functions in tests.lib.path.Path. 2019-07-02 18:48:44 -04:00
Ian Wienand 0dbab23df9 Add SHA256 hash of .whl as info output (#5908)
* Add SHA256 hash of .whl as info output

Currently I'm trying to debug some issues with what appear to be
corrupt wheels.  It would be very useful to see what pip thought the
state of things was as it wrote the wheel output; if a final corrupt
distributed file is then different to what pip has saved in its build
logs, you know the problem is somewhere after pip but before
distribution.

Currently we get a log of the initial creation, then the stamp when it
gets moved in the final output location, e.g.:

 creating '/tmp/pip-wheel-71CpBe/foo-1.2.3-py2.py3-none-any.whl
 ...
 Stored in directory: /opt/wheel/workspace

A lot happens in between this, so my suggestion is we add the final
output file and it's hash before the "Stored in directory:", e.g. you
now see:

 Building wheels for collected packages: simple
   Running setup.py bdist_wheel for simple: started
   Running setup.py bdist_wheel for simple: finished with status 'done'
   Finished: simple-3.0-py3-none-any.whl sha256=39005a57a6327972575072af82e11d0817439fe6a069381f6f2a123a8c0bf1cf
   Stored in directory: /tmp/pytest-of-iwienand/pytest-18/test_pip_wheel_success0/workspace/scratch
 Successfully built simple

Despite the hash being fairly important for things like
--require-hashes, AFAICS the final hash is not put in the logs at all
currently, so I think this is generically helpful.

* Reword wheel hash details output

This rewords the output to be more like the form of the preceding
messages.  Additionally the size is added, since we have calculated it
anyway.  The output will now look like:

 Collecting simple==3.0
 Building wheels for collected packages: simple
   Building wheel for simple (setup.py): started
   Building wheel for simple (setup.py): finished with status 'done'
   Created wheel for simple: filename=simple-3.0-py3-none-any.whl size=1138 sha256=2a980a802c9d38a24d29aded2dc2df2b080e58370902e5fdf950090ff67aec10
   Stored in directory: /tmp/pytest-of-iwienand/pytest-0/test_pip_wheel_success0/workspace/scratch
 Successfully built simple
2019-06-26 02:44:43 -07:00
Chris Jerdonek e0505bb152 Prevent subprocess stdout and stderr from cluttering pip's stdout. 2019-03-25 00:21:20 -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 51086b3718
Don't add wheels when checking if pip gets confused when building wheels
setuptools expects only one wheel file to be present in dist/
2019-02-05 08:35:01 +05:30
Pradyun Gedam 6463ffe195
Add failing tests for the behaviour to fix 2019-02-05 08:34:25 +05:30
Paul Moore a82b7ce5e7 Fix test_pep518_with_user_pip which was getting errors due to irrelevant changes in setuptools output 2018-10-29 23:32:13 +01:00
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
Pradyun Gedam 1694a5f1bf
Move status_codes to pip._internal.cli 2018-07-30 09:43:53 +05:30
Pradyun Gedam 030d48a25e
Merge pull request #5427 from benoit-pierre/fix_some_tests
Fix some tests
2018-06-06 13:08:53 +05:30
Benoit Pierre 1335eba819 tests: tweak `test_pip_wheel_with_user_set_in_config` (#5428)
To reduce failures when connection to PyPI is [flaky](https://ci.appveyor.com/project/benoit-pierre/pip/build/1.0.293/job/qohehq43vuwiek1p#L164).
2018-05-31 11:42:10 +05:30
Pradyun Gedam b120d24e4d
Add @pytest.mark.network to a test that did not have it (#5459) 2018-05-30 22:49:43 +05:30
Benoit Pierre f64713226e tests: fix `test_pip_wheel_fail_cause_of_previous_build_dir` 2018-05-19 12:51:27 +02:00
Benoit Pierre 04874e24fd tests: improve PEP 518 tests
- avoid hitting the index: use `common_wheels`/`script.pip_install_local`
- use `script.pip(..., use_module=True)` to simplify some tests
- improve `test_pep518_uses_build_env` parametrization
- simplify `test_pep518_with_user_pip`: we only need to check build
  requirements can be installed, so no need for testing with both
  `install` and `wheel` command
- fix `test_pip_wheel_with_pep518_build_reqs_no_isolation`: building
  pep518-3.0 without isolation should fail if the build requirements
  are not installed.
2018-05-18 23:45:55 +02:00
Benoit Pierre 6da1d9e47c fix PEP 518 support
* fix build environment handling when using PyPy
* do use the build environment for all build commands
* allow installing and building a wheel of a PEP 518 enabled
  package without prior installation of setuptools and/or wheels
* fix check for minimum supported requirements for PEP 518 support:
  - correctly handle complex requirements
  - both setuptools and wheels are needed
2018-04-08 14:06:11 +02:00
Paul Moore 17e0d115e8 Fix for issue 5085 (--user set in config causes pip wheel to fail) 2018-03-25 18:22:18 +01:00
Pradyun Gedam c08d4cc806
Add --no-build-isolation for disabling build isolation 2018-03-09 00:01:26 +05:30
Pradyun Gedam 4c147397ea
Merge branch 'master' into cache/ephem-wheel-cache 2018-01-24 02:15:21 +05:30
Pradyun Gedam e31d784b41
Rename a few tests to add the word "basic"
This essentially allows me to do an overall check general check by running the tests using pytest's `-k basic` syntax. Given that I like running tests often and that, in general, I make typos more often than changes that break core functionality, I think this will reduce cycle times for me.
2017-12-16 23:43:46 +05:30
Pradyun S. Gedam ebf06ceb9d Merge master 2017-10-04 16:58:31 +05:30
Donald Stufft 95bcf8c5f6 Move all internal APIs to pip._internal 2017-08-31 14:53:00 -04:00
Xavier Fernandez b709b1ef4a Add a common_wheels fixtures providing wheel & setuptools wheels 2017-07-21 18:08:53 +02:00
Thomas Kluyver ee67867369 Allow temp files for another test
When there's a previous build directory, no_clean is set
2017-07-05 20:05:24 -04: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
Thomas Kluyver 1164677d05 Merge branch 'pep518' of github.com:takluyver/pip into pep518 2017-04-26 13:45:48 +01:00
Thomas Kluyver 65585b962e Allow temp files in test of --no-clean option 2017-04-26 13:38:13 +01:00