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

62 commits

Author SHA1 Message Date
Chris Hunt
667dc392e5 Remove unused futurewheel fixture 2020-01-31 19:33:51 -05:00
Chris Hunt
e83e134f5f Use wheel_builder for future wheel functional test 2020-01-31 19:33:48 -05:00
Chris Hunt
33043ba22f Use pkg_resources.Distribution derived from wheel directly
We now extract all metadata files from the wheel directly into memory
and make them available to the wrapping pkg_resources.Distribution via
the DictMetadata introduced earlier.
2020-01-05 10:57:14 -05:00
Chris Hunt
f5684ed7ae Use shared_data fixture in wheel install tests
shared_data avoids copying the entire data directory, so use it in cases
where we know pip won't have any opportunity to edit the data files
(where we're passing tmpdir for --find-links).
2020-01-03 18:25:02 -05:00
Chris Hunt
d468da2796 Explicitly copy required packages to tmpdir for wheel install tests
Any test using --find-links data.packages is potentially using several
packages. By copying specifically the packages we need, we can more
easily see the packages that each test depends on and avoid using the
`data` fixture.
2020-01-03 18:23:48 -05:00
Chris Hunt
4e5d854456 Normalize --find-links argument format in wheel install tests 2020-01-03 17:58:40 -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
Christopher Hunt
8c888a2287
Simplify getting info directories for wheel installation (#7526)
* Edit subdirs of top-level instead of checking in each directory

Previously, we were checking whether the top of the relative path ended
with .data. Now, we do not recurse into those directories, so there's no
need to check every time.

* Store info_dir in separate variable

Instead of working with a list everywhere, we use the single info_dir.

* Separate variables for info_dir and the destination path
* Use destination .dist-info dir only when needed

By initially storing just the name of the folder we ensure our code is
agnostic to the destination, so it'll be easier to install from a zip
later.

* Use os.listdir instead of os.walk for wheel dir population

Since we only execute any code when basedir == '', we only need the
top-level directories.

* Inline data_dirs calculation
* Inline info_dirs calculation
2019-12-30 23:59:23 +08:00
Chris Hunt
93900e1199 Only check for .dist-info directories at the top-level
Previously we were restricting to a single .dist-info directory anywhere
in the unpacked wheel directory. That was incorrect since only a
top-level .dist-info directory indicates a contained "package". Now we
limit our restriction to top-level .dist-info directories.
2019-12-28 15:49:08 -05:00
Chris Hunt
e5495cf6a1 Raise UnsupportedWheel when .dist-info doesn't match name
This aligns with the previous behavior that would have enforced the
found .dist-info directory starting with the name of the package.

We raise UnsupportedWheel because it looks better in output than the
AssertionError (which includes traceback).
2019-12-21 21:27:49 -05:00
Chris Hunt
0d865d8fe3 Add test for multiple .dist-info in wheel 2019-12-21 10:51:57 -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
Chris Jerdonek
76a89542a8
Merge pull request #6856 from chrahunt/maint/remove-unneeded-expect-error-stderr
Remove unnecessary expect_error
2019-08-12 15:08:56 -07:00
Chris Hunt
0a6b3cedae Remove unnecessary expect_error. 2019-08-10 22:39:57 -04:00
Albert Tugushev
aaf86008d0 Unskip pip install from wheel with headers
Closes #1373.
2019-08-06 01:28:28 +03:00
Chris Hunt
39ac9ca351 Rename compatible functions in tests.lib.path.Path. 2019-07-02 18:48:44 -04:00
Pradyun Gedam
e55fcea956
Add tests for the bug 2019-01-23 09:48:04 +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
Bernhard M. Wiedemann
f4bda78815 Sort list of RECORD entries
Without sorting, the 'installed' hash had entries in random order
that caused output to differ for every run.

See https://reproducible-builds.org/ for why this matters.

Sorting all entries to make testing easier.
2018-09-11 13:51:33 +02:00
Pradyun Gedam
54722aa7ec
Remove unused imports 2018-06-13 13:17:30 +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
Benoit Pierre
961737ab98 Fix integration tests on Windows (#4769) 2017-10-06 20:51:42 +01: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
Pradyun S. Gedam
1832569530 Sort all imports 2017-05-16 15:47:47 +05:30
fiber-space
fa7aeb6cc8 Fixes destination directory of data_files when 'pip install --target' is used (#4092) (#4152) 2017-03-26 23:55:50 +02:00
Bruno Oliveira
c73abf81db Avoid importing TestFailure at the top level
This will make pytest-3.0 emit a warning:

cannot collect test class 'TestFailure' because it has a __init__ constructor
2016-07-28 21:36:45 -03:00
Donald Stufft
3b3978b994 Merge pull request #3284 from ncoghlan/pep376-installer-file
Record pip in INSTALLER file
2016-01-19 10:41:08 -05:00
Jeff Barber
24a5cc6a42 Fix for issue #2834 with test 2016-01-03 17:38:36 -05:00
Nick Coghlan
a925c88ed6 Record pip in INSTALLER file 2015-12-04 19:22:19 +10:00
Domen Kožar
e14a66f1b9 Support --prefix argument to install command.
There was no way to override prefix for an installation for wheels
previously. The default it whatever sys.prefix points to.
2015-11-22 19:13:51 +01:00
Robert Collins
62041d3ca8 Cleanup now use_wheel is the default.
There were a bunch of tests passing use_wheel unnecessarily, this
makes the change to remove use_wheel larger than it needs to be.
2015-04-20 20:12:03 +12:00
Donald Stufft
a88bc0de73 Send log messages >= logging.WARNING to stderr 2015-04-06 23:11:16 -04:00
Matej Stuchlik
c5024dc851 Mark tests requiring Internet access 2015-01-15 00:53:15 +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
Berker Peksag
eee2334c92 Silence byte compile errors when installation succeed.
Fixes #1873.
2014-08-21 16:40:02 +03:00
Marcus Smith
3d64db281b merge 1.5.X into develop 2014-05-26 15:06:36 -07:00
Marcus Smith
3066157cc3 when installing from wheel files, parse the filename to build the requirement 2014-05-25 21:00:39 -07:00
Marcus Smith
8d37e2abcf turn on --user tests for pypy 2014-03-29 09:48:12 -07: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
Matthew Iversen
b26d91c880 Ensure wheel-Version is compatible with pip 2014-02-19 20:01:22 -05:00
Matthew Iversen
6cd145ab62 Add unit test for check_compatibility 2014-02-18 15:21:18 +11:00
Matthew Iversen
1b6b537673 Fix tests to expect installation or not 2014-02-15 17:47:44 +11:00
Matthew Iversen
13f6c68f0c Ensure wheel-Version is compatible with pip 2014-02-15 17:21:22 +11:00
Donald Stufft
9f027337a8 Use Flake8 on the test of pip's Python files 2014-01-28 19:47:58 -05:00
Marcus Smith
c2c1eaddc7 - have the basic wheel install test, use a basic wheel
- have a separate test for a wheel with headers
- skip the header test on pypy for now due to virtualenv bug
2013-12-08 14:05:08 -08:00
Marcus Smith
0017f1b1cb use latest wheel from pypi when testing 2013-12-04 19:38:10 -08: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
Donald Stufft
6dca500f69 Set the executable bit on files generated by distlib's ScriptMaker 2013-11-02 12:46:18 -04:00
Paul Moore
a7949308df Added comments and reqordings based on code review 2013-11-01 17:28:35 +00:00