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

3582 commits

Author SHA1 Message Date
Pradyun Gedam
bb7fce7209
Ensure we're not mishandling local indexes
Signed-off-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
2020-11-25 14:12:37 +00:00
Pradyun Gedam
ce46a5e36d
Re-install local candidates unconditionally
Signed-off-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
2020-11-25 14:12:08 +00:00
Pradyun Gedam
84382715f0
Merge pull request #9096 from uranusjr/new-resolver-constrainting-extraed
Constrainting an extra-ed dependency
2020-11-23 10:57:39 +00:00
Tzu-ping Chung
c3670b36cb 2020 resolver can constrain path/URL to versions 2020-11-23 11:51:14 +08:00
Pradyun Gedam
aa847eaa8a
Merge pull request #9123 from sbidoul/pip-wheel-editable-fix-sbi 2020-11-22 21:32:44 +00:00
Stéphane Bidoul
a24d198c15
Do not download editables while preparing requirements
Downloading is done at the end of the download command
just like any other requirement. This is necessary to avoid
archiving editable requirements to a zip file when running
pip wheel.
2020-11-22 21:14:09 +01:00
Tzu-ping Chung
0f6750c98c Modify old tests to accomodate restriction removal 2020-11-21 22:14:24 +08:00
Tzu-ping Chung
9b3cd280fd Add failing test 2020-11-21 22:14:24 +08:00
Stéphane Bidoul
11d07016d9
Add failing test for issue 9122 2020-11-12 13:20:45 +01:00
Stéphane Bidoul
9613c887f1
Test download editable 2020-11-12 13:20:44 +01:00
Pradyun Gedam
7be91574d9
Update message displayed on conflicts post-resolution 2020-11-12 06:53:29 +05:30
Stéphane Bidoul
3defc24e31
Removed unused comes_from argument of parse_requirements 2020-11-08 19:07:28 +01:00
Tzu-ping Chung
d08b4d99e2 Use packaging.version to check version equality 2020-11-03 16:04:35 +08:00
Xavier Fernandez
4dc48da9db utils: make Hashes object hashable 2020-10-31 15:54:54 +01:00
Xavier Fernandez
9725229888 Add --exclude option to pip freeze and pip list commands 2020-10-30 21:50:59 +01:00
Pradyun Gedam
cdc5422ed5
Merge pull request #9019 from pradyunsg/flip-the-switch-on-new-resolver 2020-10-31 00:36:32 +05:30
Pradyun Gedam
64ff484c76
Skip tests that fail on Python 2 2020-10-30 23:09:00 +05:30
Pradyun Gedam
8a5656f7b1
Fix a flaky test 2020-10-30 23:08:59 +05:30
Pradyun Gedam
a56fefc764
Add debugging information to CI 2020-10-30 23:08:59 +05:30
Pradyun Gedam
16c3205184
Add a better error message for no-more-responses 2020-10-30 23:08:59 +05:30
Pradyun Gedam
53db14b188
Mark test about install order as an xfail 2020-10-30 23:08:51 +05:30
Pradyun Gedam
ec9bb10922
Update YAML tests for resolver changes 2020-10-30 23:08:47 +05:30
Pradyun Gedam
6f26fb9fee
Update tests for resolver changes 2020-10-30 23:08:31 +05:30
Xavier Fernandez
c33cf49381 freeze: deprecate option --find-links 2020-10-30 13:41:27 +01:00
Pradyun Gedam
6859de08d9
Get the resolver name directly from test CLI 2020-10-30 07:16:25 +05:30
Pradyun Gedam
07ec3013f0
Drop custom logic for new_resolver tests 2020-10-30 07:16:19 +05:30
Pradyun Gedam
5cba61e118
Switch to resolver variants in the test suite 2020-10-30 07:16:19 +05:30
Pradyun Gedam
6028e6a0fb
Change how we skip a failing test 2020-10-30 07:16:19 +05:30
Pradyun Gedam
00e531a16e
Merge pull request #9017 from pradyunsg/backtracking-messaging 2020-10-28 18:25:29 +05:30
Daniel Katz
7237bd3397 Respond to feedback, and add functional tests. 2020-10-27 19:00:22 -04:00
Daniel Katz
cea9f32dae Support multiple abi and platform values for pip download. 2020-10-27 19:00:22 -04:00
Pradyun Gedam
9a5441c331
Merge pull request #9049 from pfmoore/remove_build_dir 2020-10-27 22:41:47 +05:30
Pradyun Gedam
f2852cd775
Merge pull request #8991 from asottile/dead_code
delete some dead test code (VERBOSE_FALSE)
2020-10-27 21:45:20 +05:30
Paul Moore
52e1c9a39c Not clear why this didn't fail before... 2020-10-27 15:49:38 +00:00
Paul Moore
0c2a2bc803 Mark a couple of tests that still use --build as xfail 2020-10-27 15:24:36 +00:00
Paul Moore
7c4c5b8330 Remove test_pip_wheel_fail_cause_of_previous_build_dir as it's no longer valid 2020-10-27 15:24:36 +00:00
Pradyun Gedam
b39aeeb6df
Merge pull request #9050 from sbidoul/fix-freeze-direct_url-editable-sbi 2020-10-27 19:34:10 +05:30
Pradyun Gedam
f3307a5103
Present a message upon first backtrack 2020-10-27 19:32:36 +05:30
Pradyun Gedam
95171c881f
Display messages when backtracking on a package 2020-10-27 19:32:35 +05:30
Pradyun Gedam
45d3a3e859
Update tests for new signature 2020-10-27 01:05:29 +05:30
Pradyun Gedam
abb3d0fae3
Move build_env tests to functional
These tests use the script fixture which as a 30s setup time on my
machine. This KILLS productivity when trying to run unit tests as part
of a feedback loop during development.
2020-10-25 23:32:26 +05:30
Pradyun Gedam
66bb8a88c4
Add a small delay between re-runs 2020-10-25 23:03:10 +05:30
Pradyun Gedam
9faf431fbb
Breakup conditional for readability 2020-10-25 23:02:59 +05:30
Stéphane Bidoul
d5a2007e8f
Avoid AssertionError in pip freeze with editable direct URLs 2020-10-25 15:18:02 +01:00
Tzu-ping Chung
761433cee8 Eliminate len() usage in tests 2020-10-13 16:12:11 +08:00
Tzu-ping Chung
d22775819b Test for candidate ordering 2020-10-13 16:12:11 +08:00
Tzu-ping Chung
8326148149 Implement "lazy sequence" to avoid Internet
find_matches() is modified to return a special type that implements
the sequence protocol (instead of a plain list). This special sequence
type tries to use the installed candidate as the first element if
possible, and only access indexes when the installed candidate is
considered unsatisfactory.
2020-10-13 16:06:00 +08:00
Anthony Sottile
336e979894 delete some dead test code (VERBOSE_FALSE)
was just browsing through some files and noticed this
2020-10-12 16:05:05 -07:00
6887b0795b Merge usage of download_dir and wheel_download_dir
In every cases, at least one of them is None.  By doing this,
it is also possible to simplify wrapper codes around download_dir.
2020-10-07 13:42:21 +07:00
Pradyun Gedam
8aab76c63f
Merge pull request #8910 from hugovk/pip-cache-http
Include http subdirectory in 'pip cache info' and 'pip cache purge'
2020-10-02 13:26:00 +05:30
Hugo van Kemenade
0652a2f016 Rename to 'Package index page cache location' 2020-10-02 09:59:38 +03:00
Hugo van Kemenade
d45ba65c37 Include http directory in 'pip cache info' and 'pip cache purge' 2020-09-24 01:33:56 +03:00
Pradyun Gedam
58c594c06b
Prepare isort for black 2020-09-23 21:47:47 +05:30
Pradyun Gedam
faee60baea
Merge pull request #8902 from pradyunsg/linter-updates 2020-09-23 21:44:55 +05:30
Pradyun Gedam
25ab172b55
Update linter: isort 2020-09-23 19:52:28 +05:30
Pradyun Gedam
4c534e65d2
Tweak message when -r is not passed on a requirements.txt 2020-09-23 19:46:36 +05:30
Pradyun Gedam
e61bb616ef
Merge pull request #8839 from uranusjr/new-resolver-hash-intersect 2020-09-17 10:58:44 +05:30
Tzu-ping Chung
179ccbe6f5 Add tests for empty hash intersection 2020-09-11 15:01:50 +08:00
Devesh Kumar Singh
9450f8837a Use format options for abspath 2020-09-11 09:23:51 +05:30
Devesh Kumar Singh
d22becc073 Add unit tests for --abspath flag 2020-09-11 09:23:51 +05:30
Xavier Fernandez
822d42b11a
Merge pull request #8614 from McSinyx/monkeypatch.setenv
Use monkeypatch.setenv to mock env vars
2020-09-04 11:05:15 +02:00
4a2e03c4ff Use monkeypatch for env var in wheel unit tests 2020-09-04 15:06:08 +07:00
cd549eb7f1 Use mock to patch for TZ env var 2020-09-04 15:06:08 +07:00
Xavier Fernandez
83f1640827
Merge pull request #8578 from McSinyx/parse-count
Allow verbose/quiet level to be specified via config file and env var
2020-09-03 18:34:53 +02:00
Tzu-ping Chung
753ad4d230 F Python 2 2020-09-03 17:35:22 +08:00
Tzu-ping Chung
dfaa111004 Pull in hashes from constraint files 2020-09-03 17:26:52 +08:00
Tzu-ping Chung
700eb7734f Hashes from lines should intersect, not union 2020-09-03 17:19:01 +08:00
Pradyun Gedam
567630b4b8
Merge pull request #8758 from uranusjr/new-resolver-requires-python-when-no-deps 2020-09-02 20:09:32 +05:30
Pradyun Gedam
a99190459e
Merge pull request #8817 from sbidoul/improve-git-checkout 2020-09-01 18:40:51 +05:30
Stéphane Bidoul
eff32df28a
Add spacing in test
Co-authored-by: Pradyun Gedam <3275593+pradyunsg@users.noreply.github.com>
2020-08-30 18:15:35 +02:00
Stéphane Bidoul
5797a080b6
Fix test that now requires a working git repo 2020-08-30 11:52:06 +02:00
Stéphane Bidoul
1c61b4679f
Add failing test fetching a git commit in refs 2020-08-30 11:47:13 +02:00
Tzu-ping Chung
8b2b92485c Include Requires-Python dep even with --no-deps 2020-08-26 09:49:25 +08:00
Pradyun Gedam
b7075b9351
Merge pull request #8778 from hugovk/deprecate-3.5
Deprecate support for Python 3.5
2020-08-25 20:40:01 +05:30
Pradyun Gedam
e17f845475
Merge pull request #8522 from NoahGorny/fix-requirements-file-options
install: Update extra-index-url in session from requirements file
2020-08-25 15:08:11 +05:30
c84ef7a67c Mark tests using remote svn and hg as xfail
The source repositories for testing is no longer available.
2020-08-24 09:43:50 +07:00
Hugo
e93257c080 Warn Python 3.5 support is deprecated and will be removed in pip 21.0, Jan 2021 2020-08-18 15:22:16 +03:00
14397418d1 Test hash checking for fast-deps 2020-08-17 20:46:39 +07:00
46b938349a Allow py2 deprecation warning from setuptools 2020-08-14 17:56:15 +07:00
b46576d933 Give batch downloader a separate class 2020-08-12 16:07:27 +07:00
078e0effb7 Add memoization mechanism for file download
This is intentionally dependent from caching, which relies on cache dir.
2020-08-11 22:39:42 +07:00
e62f16e969 Make Downloader perform the download 2020-08-11 22:36:08 +07:00
Pradyun Gedam
8eea660e03
Merge pull request #8744 from hroncok/keyring_global_nope
When one keyring attempt fails, don't bother with more
2020-08-11 15:41:02 +05:30
Pradyun Gedam
4c7bbdb4e4
Merge pull request #8702 from uranusjr/get-distribution-looks-for-all 2020-08-10 20:30:55 +05:30
Tzu-ping Chung
312d1d0473 Add failing test for constraints with markers 2020-08-07 13:43:49 +08:00
Noah Gorny
aae63795b2 reqfile: Update extra-index-url/index-url in session from requirements file
Also update the relevant tests
2020-08-06 19:25:31 +03:00
487d00295c Define RequirementPreparer._session 2020-08-06 18:42:59 +07:00
709ad37b2f
Make assertion failure give better message (#8692) 2020-08-06 15:40:13 +05:30
Tzu-ping Chung
4fce2ea88c Add test to ensure get_distribution() behavior 2020-08-06 10:59:07 +08:00
Pradyun Gedam
ee4371c386
Merge pull request #8685 from chrahunt/use-preparer-for-lazy-wheels 2020-08-04 18:46:56 +05:30
Pradyun Gedam
4fa31d509f
Merge pull request #8678 from uranusjr/new-resolver-no-deps-extras-install-self 2020-08-04 06:48:11 +05:30
Miro Hrončok
ba062c3ed0 When one keyring attempt fails, don't bother with more
This makes https://github.com/pypa/pip/issues/8090 much less painful.
2020-08-03 12:34:26 +02:00
Chris Hunt
f0d4df10eb Propagate lazy_wheel option through RequirementPreparer
Reduces dependence on Candidate (and Resolver (and Factory)).
2020-08-02 18:40:11 -04:00
Pradyun Gedam
7e6ff08aae
Merge pull request #8656 from chrahunt/gracefully-handle-bad-data-paths
Trace a better error message on installation failure due to invalid .data files in wheels
2020-08-02 19:55:40 +05:30
Tzu-ping Chung
b4632d080b Failing test for new resolver + extras + --no-deps 2020-08-02 16:12:46 +08:00
Pradyun Gedam
e51a027964
Merge pull request #8659 from uranusjr/fix-get-distribution-dot-in-name
Canonicalize name in check_if_exists
2020-08-02 07:44:24 +05:30
0ef877339a Make assertions independent of log prefixes 2020-08-01 20:26:44 +07:00
Tzu-ping Chung
ea47920767 Add test case for SlikSVN version parsing 2020-08-01 02:03:45 +08:00
Tzu-ping Chung
1fd5098b24 Canonicalize name in check_if_exists
The previous implementation uses pkg_resources.get_distribution(), which
does not canonicalize the package name correctly, and fails when
combined with pip's own get_distribution(), which does canonicalize
names. This makes InstallRequirement.check_if_exists() only use pip's
own canonicalization logic so different package name forms are matched
as expected.
2020-07-30 22:04:51 +08:00
Chris Hunt
3f9b326c11 Provide a reasonable error on invalid scheme keys
Originally we would throw an `AttributeError` if a bad scheme key was
used. After refactoring we would throw a `KeyError`, which isn't much
better. Now we call out the wheel being processed, scheme key we didn't
recognize, and provide a list of the valid scheme keys. This would
likely be useful for people developing/testing the wheel.
2020-07-29 22:24:09 -04:00
Chris Hunt
864f0e0efa Explicitly handle incorrect .data paths during wheel install
Previously our wheel installation process allowed wheels which contained
non-conforming contents in a contained .data directory.

After the refactoring to enable direct-from-wheel installation, pip
throws an exception when encountering these wheels, but does not include
any helpful information to pinpoint the cause.

Now if we encounter such a wheel, we trace an error that includes the
name of the requirement we're trying to install, the path to the wheel
file, the path we didn't understand, and a hint about what we expect.
2020-07-29 18:12:16 -04:00
Pradyun Gedam
a8edffda1c
Merge pull request #8594 from pradyunsg/improve-install-conflict-warning 2020-07-28 18:22:53 +05:30
a85be3f555 Test verbose/quiet level specified via env var and config file 2020-07-28 10:13:24 +07:00
Pradyun Gedam
3f88476e4f
This counts as a fix right? 2020-07-27 20:06:55 +05:30
Pradyun Gedam
3962f9d2b8
Moar tests getting updated 2020-07-27 19:51:47 +05:30
Pradyun Gedam
b9ff93f7ba
Update test messages to reflect new reality 2020-07-27 19:51:47 +05:30
Pradyun Gedam
c631de61b9
Drop no-longer-used deprecated_python fixture 2020-07-27 19:51:47 +05:30
Pradyun Gedam
e4f8e0a2b8
Change {matches -> contains}_expected_lines
This also updates invocations that can't be translated as-is into a
different equivalent check.
2020-07-27 19:51:47 +05:30
Pradyun Gedam
a89ede7da3
tests: Check only the last output lines 2020-07-27 19:51:47 +05:30
Pradyun Gedam
43da7c8283
Make the YAML tests happier 2020-07-27 13:49:21 +05:30
Pradyun Gedam
7056132f6f
Merge pull request #8601 from rouge8/use-feature-requirements-file 2020-07-27 13:19:51 +05:30
Tzu-ping Chung
906072a292 Test for conflict message from requirements.txt 2020-07-26 15:59:07 +08:00
5b1093fc75 Use monkeypatch.*env in conftest and tests.lib
Session fixtures have to use mock.patch.dict though
2020-07-25 20:46:45 +07:00
c564a3d541 Use monkeypatch.setenv in config and option tests 2020-07-25 20:46:45 +07:00
Stéphane Bidoul
ccdfa74d79
Reduce reliance on .egg-info directories in test suite
Make more tests run with with_wheel and test
that a .dist-info directory is created.
2020-07-25 13:02:20 +02:00
Stéphane Bidoul
38fe3c2f14
Percolate --use-feature from req file upwards
We explicitly propagate --use-feature options from req files upwards.
This is not strictly necessary for the option to be enabled, because
of the default value is a global list, but that implicit behaviour is
certainly accidental, so we make it explicit, with a test.
2020-07-25 11:14:04 +02:00
Pradyun Gedam
89a51a6fef
Merge pull request #8588 from McSinyx/fast-deps
Use lazy wheel to obtain dep info for new resolver
2020-07-24 09:01:56 +05:30
Pradyun Gedam
f94580bad7
Print output in test_debug__library_versions
This should make debugging issues in this test easier.
2020-07-22 19:57:20 +05:30
4efae5c21a Add integration tests for experimental feature fast-deps
Test pip {download,install,wheel} where requirements have dependencies
listed in their wheels' metadata.
2020-07-21 16:00:34 +07:00
Pradyun Gedam
982aac544e
Merge pull request #8584 from McSinyx/range-unsupported-exc 2020-07-21 13:53:20 +05:30
Andy Freeland
7a3c802626 Attempt to test --use-feature in pip freeze
I can't get the functional tests to run locally...
2020-07-19 02:44:12 -07:00
Andy Freeland
3eef588a03 Support '--use-feature' in requirements files
This patch adds support for `--use-feature` in requirements files
so that a project that wants all contributors using the same pip
features can specify it in the requirements file. For example, to ensure
a requirements file uses the new resolver:

```
--use-feature=2020-resolver
boto3
boto3==1.13.13
```

This is a new version of #8293.
2020-07-18 16:08:47 -07:00
d363b4a427 Replace tabs by spaces for consistency 2020-07-18 17:00:59 +07:00
05bdc69aa3 Make test more explicit 2020-07-17 14:33:19 +07:00
cb8d81d135 Nitpick logging calls 2020-07-17 14:33:19 +07:00
892018eaf2 Use local server for an unit test for lazy wheel 2020-07-16 21:09:59 +07:00
Chris Hunt
c40d7b2122
Merge pull request #8575 from chrahunt/tests/add-better-entrypoint-test
Make wheel entrypoint error test higher-level
2020-07-15 16:52:35 -04:00
Pradyun Gedam
fa2fceecf1
Merge pull request #8189 from gutsytechster/remove_raise_for_status 2020-07-15 18:06:27 +05:30
Pradyun Gedam
61d497120f
Merge pull request #8424 from jku/8288-deprecate-nonconforming-extras 2020-07-15 18:03:00 +05:30
db217992bd Use more descriptive exception when range requests are unsupported 2020-07-15 16:28:53 +07:00
Chris Hunt
607ec6c342
Merge pull request #7416 from chrahunt/maint/add-coverage
Add basic test coverage configuration
2020-07-14 19:22:56 -04:00
Chris Hunt
328e4c06da
Merge pull request #8502 from uranusjr/new-resolver-binary-compat-on-target
Ensure binary compat is checked in --target
2020-07-13 20:38:13 -04:00
Jussi Kukkonen
76b20d738e Deprecate requirements format "base>=1.0[extra]"
This requirements format does not conform to PEP-508. Currently the
extras specified like this work by accident (because _strip_extras()
also parses them). The version checks end up being done with a
misparsed version '1.0[extra]' -- this is not changed in this commit.

Add deprecation warning and fix the corresponding resolver test. Add a
command line test.

Note that we really only check that the Requirement has SpecifierSet
with a specifier that ends in a ']'. A valid version number cannot
contain ']' and no wheels currently on pypi have versions ending in ']'.
2020-07-13 12:33:50 +03:00
Chris Hunt
05f2d9ebf6 Make entrypoint error test higher-level
The current tests didn't catch the bug that the new tests do,
so they have been removed. Using higher-level tests can give us more
confidence that things work end-to-end and are less likely to get in
the way of refactoring.

The new test has been marked xfail since the bug is still present.
2020-07-11 15:45:18 -04:00
Chris Hunt
8bf5731b84
Merge pull request #8562 from chrahunt/extract-direct-from-zip-refactoring
Install directly from wheels, without unpacking into an intermediate directory
2020-07-10 21:33:16 -04:00
Chris Hunt
15b7afbcad
Merge pull request #8266 from gutsytechster/add_logs_for_install
feat(): Add logs for pip environment when installing
2020-07-10 09:36:13 -04:00
Prashant Sharma
f7abe1f874
test(functional/test_install): Use shared_data for installing package 2020-07-10 16:20:30 +05:30
Chris Hunt
e9508591ce
Merge pull request #8556 from chrahunt/maint/fail-on-install-location-options
Disallow explicitly passing install-location-related arguments in --install-options
2020-07-09 21:25:20 -04:00
Chris Hunt
d13ec25361 Prevent path traversal when installing wheels directly 2020-07-09 21:21:35 -04:00
Tzu-ping Chung
152642ddcf Ensure binary compat is checked in --target 2020-07-09 21:23:21 +08:00
gutsytechster
0ccbad8367
feat(): Add logs for pip environment when installing 2020-07-09 18:15:43 +05:30
Prashant Sharma
07e8712677
reformat(pip/_internal): Resolve lint errors 2020-07-09 15:15:01 +05:30
Christopher Hunt
2f9b50c097
Merge pull request #8534 from chrahunt/thoroughly-test-header-installation
Make wheel header installation test more explicit
2020-07-08 17:21:47 -04:00
Christopher Hunt
5da104af71
Merge pull request #8547 from chrahunt/test-record-population
Test RECORD population for data files
2020-07-08 08:52:42 -04:00
gutsytechster
8c267e6e39
feat(pip/_internal/*): Use custom raise_for_status method 2020-07-08 18:08:55 +05:30
Chris Hunt
cb540f30e3 Add basic test coverage configuration
This handles:

* Sub-processes within unit tests (thanks pytest-cov)
* Our pytest-fixture-based virtual environments and subprocesses
  therein
* Running with xdist (e.g. `-n auto`)
* Combining results from all of the above using paths rooted with
  `src/pip/*`

This doesn't handle:

* Platform-specific branches
* Python 2
* CI integration
2020-07-07 21:58:55 -04:00
Christopher Hunt
b27956928f
Merge pull request #8553 from uranusjr/header-location-prefix
Header location prefix
2020-07-07 21:37:50 -04:00
Christopher Hunt
53aa1a932b
Merge pull request #8538 from McSinyx/parallel-test-teardown
Make utils.parallel tests tear down properly
2020-07-07 21:19:28 -04:00
Chris Hunt
f878fcdeec Rename function that reject location install options
Since it no longer shows a deprecation warning, the previous name
doesn't fit.
2020-07-07 19:11:11 -04:00
Chris Hunt
89572a7d40 Throw CommandError on any location-related install options 2020-07-07 19:11:11 -04:00
Chris Hunt
b46d8ab01a Refactor overriding test to not use disallowed option
Similar to our previous test refactoring, this removes the usage of
`--home` from the test command.

"Overriding" in the original test meant "placed after" in the
command-line arguments, which makes sense because setuptools will use
the last argument passed.
2020-07-07 19:11:02 -04:00
Chris Hunt
50d7b930d3 Create more robust test for isolated --install-option
The current test depends on passing `--home` to `--install-option`.
Since we would like that to fail, we need to use another argument. None
of the other possible arguments have a visible side-effect, so we just
write the provided arguments to a file and check that in the test.
2020-07-07 19:10:27 -04:00
Chris Hunt
ffddab6986 Test that RECORD is populated correctly for data files 2020-07-07 09:25:16 -04:00
Chris Hunt
a365764e57 Add test for RECORD population by make_wheel 2020-07-07 09:25:16 -04:00
Tzu-ping Chung
600d5272e6 Add failing test for --prefix location 2020-07-07 18:53:33 +08:00
Christopher Hunt
334f06e224
Merge pull request #8054 from deveshks/correct-package-name-while-install
Canonicalize req name while doing pre-install package search
2020-07-06 12:10:33 -04:00
Christopher Hunt
161ee7f852
Merge pull request #8548 from chrahunt/better-wheel-empty-dir-test
Refactor test for empty directory in wheel
2020-07-06 09:25:31 -04:00
Devesh Kumar Singh
04fedfe53c Create custom get_distribution function 2020-07-06 13:42:05 +05:30
Devesh Kumar Singh
2bdec6c9fd Parametrize unit test 2020-07-06 13:32:09 +05:30
Devesh Kumar Singh
40261a475f Add unit tests to verify pkg name normalization 2020-07-06 13:32:09 +05:30
Tzu-ping Chung
01e0700e68 Skip installing if the version matches locally
This check only applies to explicit requirements since we avoid
downloading the dist from finder altogether when there is a matching
installation (although the check wouldn’t change the behaviour in that
case anyway).

We can do this when we build the `ExplicitRequirement` instead, like how
we did for `SpecifierRequirement`, but that would require us to resolve
the direct requirement’s version eagerly, which I don’t want to.

The implemented approach checks the version only after resolution, at
which point the distribution is already built anyway and the operation
is cheap.
2020-07-06 11:06:14 +08:00
Christopher Hunt
4ba51d2e9c
Merge pull request #8501 from uranusjr/refactor-create-link-collector
Tidy up link collector constructor imports
2020-07-05 21:44:31 -04:00
Chris Hunt
ba96ba3b08 Reduce empty directory test coupling to implementation
Our previous test required that the implementation use a temporary
directory and unpack the wheel in-place. Now we just provide a
conventional empty directory in the wheel file itself.
2020-07-05 20:16:36 -04:00
Chris Hunt
a9c7f229b0 Create sample project wheel inline 2020-07-05 20:16:36 -04:00
Christopher Hunt
1f8a4dde26
Merge pull request #8541 from chrahunt/refactor/compile-file-next-steps
Byte-compile files after installation
2020-07-05 12:56:39 -04:00
Chris Hunt
42c01ae97e Normalize Path to str in wheel tests
In our next commit we will use the scheme path to locate files to
byte-compile. If the scheme path is a `Path`, then that causes
`compileall.compile_file` (via `py_compile.compile`) to fail with:

```
.tox/py38/lib/python3.8/site-packages/pip/_internal/operations/install/wheel.py:615: in install_unpacked_wheel
    success = compileall.compile_file(
../../../.pyenv/versions/3.8.0/lib/python3.8/compileall.py:157: in compile_file
    ok = py_compile.compile(fullname, cfile, dfile, True,
../../../.pyenv/versions/3.8.0/lib/python3.8/py_compile.py:162: in compile
    bytecode = importlib._bootstrap_external._code_to_timestamp_pyc(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

code = <code object <module> at 0x7fa7e274f500, file "/tmp/user/1000/pytest-of-chris/pytest-37/test_std_install_with_direct_u0/dest/lib/sample/__init__.py", line 1>, mtime = 1593910285.2200587, source_size = 134

>   ???
E   ValueError: unmarshallable object
```

Debugging in gdb shows that the error is set due to the `Path` object
being present in the code object, which `marshal.dumps` can't handle
(frame 1):

```
 0  w_complex_object (v=<optimized out>, flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:564
 1  w_object (v=<Path at remote 0x7fffee51f120>, p=0x7fffffff7160) at Python/marshal.c:370
 2  w_complex_object (v=<code at remote 0x7fffee591710>, flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:544
 3  w_object (v=<code at remote 0x7fffee591710>, p=0x7fffffff7160) at Python/marshal.c:370
 4  w_complex_object (v=('1.2.0', <code at remote 0x7fffee591710>, 'main', None), flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:475
 5  w_object (v=('1.2.0', <code at remote 0x7fffee591710>, 'main', None), p=0x7fffffff7160) at Python/marshal.c:370
 6  w_complex_object (v=<code at remote 0x7fffee591ea0>, flag=<optimized out>, p=0x7fffffff7160) at Python/marshal.c:539
 7  w_object (p=0x7fffffff7160, v=<code at remote 0x7fffee591ea0>) at Python/marshal.c:370
 8  PyMarshal_WriteObjectToString (version=<optimized out>, x=<code at remote 0x7fffee591ea0>) at Python/marshal.c:1598
 9  marshal_dumps_impl (module=<optimized out>, version=<optimized out>, value=<code at remote 0x7fffee591ea0>) at Python/marshal.c:1739
 10 marshal_dumps (module=<optimized out>, args=<optimized out>, nargs=<optimized out>) at Python/clinic/marshal.c.h:124
```

In the interest of easy git bisects, we commit this fix before the code
that would expose the bug.
2020-07-05 09:38:08 -04:00
Pradyun Gedam
8db4fc8224
Merge pull request #8530 from pradyunsg/rollout-flags 2020-07-05 01:50:25 +05:30
Pradyun Gedam
107ec292c2
Merge pull request #8539 from pradyunsg/warn-on-unsupported-use-of-constraints 2020-07-05 01:48:54 +05:30
Pradyun Gedam
28592d4c31
Allow for the deprecation warning in tests 2020-07-05 01:01:02 +05:30
Chris Hunt
b5f02f9dd8 Check that expected text is written in include files
This is a little more specific than checking that we happened to create
an already-empty file, and is a better mirror for reality.
2020-07-04 14:23:10 -04:00
Chris Hunt
0b0d53e8fa Use wheel helper function instead of pre-created wheel file 2020-07-04 14:22:15 -04:00
Chris Hunt
00191b2db1 Explicitly test that header file was created as-expected
Since this is the special part of this test. This gives us more
confidence that we're doing the right thing when removing the standalone
wheel file next.
2020-07-04 14:22:15 -04:00
512221e1c1 Make utils.parallel tests tear down properly 2020-07-04 15:07:38 +07:00
Chris Hunt
3930e4b063 Drop unused argument 2020-07-03 19:46:45 -04:00
Chris Hunt
d49d97f19f Pass Wheel distribution to install.wheel.get_entrypoints
Right now we're just wiring up the arguments. Next we will actually use
them.
2020-07-03 19:46:45 -04:00
Chris Hunt
a953787152 Extract entrypoint test text construction into variable
We need this to construct the new argument to `get_entrypoints`.
2020-07-03 19:46:45 -04:00
Chris Hunt
3fad029b77 Test get_entrypoints when none are expected 2020-07-03 17:49:56 -04:00
Chris Hunt
dcd5cadcfd Expect a plain list in get_csv_rows_for_installed
This makes get_csv_rows_for_installed simpler, because it is not
modifying its arguments. We can also more easily refactor RECORD file
reading since it is now decoupled from getting the installed RECORD file
rows.
2020-07-03 12:25:12 -04:00
Pradyun Gedam
49b793cd03
Set correct envvar for new-resolver tests 2020-07-03 20:11:36 +05:30
Pradyun Gedam
79de2c8911
Switch to --use-feature for determining which resolver to use
Also changes all invocations in the tests, to the new flag.
2020-07-03 18:49:56 +05:30
Christopher Hunt
4645ecbdb0
Merge pull request #8447 from jku/use-valid-signals-on-py38
test server: Don't mask invalid signals on py38
2020-07-02 12:03:11 -04:00
Jussi Kukkonen
23ec070cf1
test server: use set of signals
This is what signal.pthread_sigmask() really wants and matches signal.valid_signals() output

Co-authored-by: Christopher Hunt <chrahunt@gmail.com>
2020-07-02 18:00:29 +03:00
Xavier Fernandez
09f9b0030d
Merge pull request #8096 from deveshks/list-config-files
Add option to list config files with pip config
2020-07-02 15:01:35 +02:00
Pradyun Gedam
e774eccf46
Merge pull request #8343 from uranusjr/entrypoint-unicode 2020-06-30 14:33:24 +00:00
Pradyun Gedam
18431be48f
Merge pull request #8467 from McSinyx/lazy-wheel 2020-06-30 13:39:04 +00:00
Pradyun Gedam
93b0683d65
Merge pull request #8470 from deveshks/remove-always-unzip 2020-06-30 13:33:30 +00:00
Pradyun Gedam
17608c43d1
Merge pull request #8465 from deveshks/collector-debug-to-warn 2020-06-29 18:28:10 +00:00
Devesh Kumar Singh
6c899ed0c8 Update warning message to specify HTTP request 2020-06-29 22:20:11 +05:30
Pradyun Gedam
3a22663ab2
Merge pull request #8320 from McSinyx/pools 2020-06-29 07:54:14 +00:00
Devesh Kumar Singh
46790a4f3c Improve warning message for invalid vcs schemes 2020-06-28 16:23:07 +05:30
Devesh Kumar Singh
499e112275 Add unit tests to check vcs and archive url with invalid scheme 2020-06-28 16:23:07 +05:30
Devesh Kumar Singh
056f119ca9 Add test to verify global config file path 2020-06-28 16:22:01 +05:30
Devesh Kumar Singh
6e62481568 Add unit tests for pip config debug 2020-06-28 16:22:01 +05:30
Devesh Kumar Singh
7a8f374c39 Add option to list config files with pip config 2020-06-28 16:22:00 +05:30
Xavier Fernandez
9a3c082070
Merge pull request #8182 from deveshks/no-input-tests
Enable --no-input option by adding docs and tests
2020-06-26 21:29:19 +02:00
Tzu-ping Chung
ec7324fba0 Tidy up link collector constructor imports
make_link_collector() was in self_outdated_check, a module responsible
for checking whether the currently-running pip is outdated, but is
imported by things that has nothing to do with this outdated check. Move
the function to be a class method in LinkCollector so the module
hierarchy makes more sense.
2020-06-26 17:31:28 +08:00
25a25a0975 Test network.lazy_wheel.dist_from_wheel_url 2020-06-26 15:15:28 +07:00
Devesh Kumar Singh
4ecd7ecbc7 Assert result string in test_prompt_for_authentication 2020-06-26 07:22:21 +05:30
Devesh Kumar Singh
6119a837ea Add unit tests for --no-input flag 2020-06-26 07:21:45 +05:30
0a3b20f9b8 Drop parallel map for Python 2 and the non-lazy variant
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2020-06-25 21:10:49 +07:00
13539d00f8 Wrap lazy map as well 2020-06-25 21:10:49 +07:00
e7f637e5ca Add tests for utils.parallel 2020-06-25 21:10:49 +07:00
Paul Moore
3dad80a314 Lint fix 2020-06-25 13:00:11 +01:00
Paul Moore
cdc4e40dad Test is checking the old resolver's broken behaviour 2020-06-25 13:00:11 +01:00
Devesh Kumar Singh
bd70025c98 Remove --always-unzip based tests 2020-06-25 16:52:15 +05:30
Tzu-ping Chung
ec1f3cc189 Fix YAML tests to reflect the new resolver error 2020-06-25 15:00:21 +08:00
Pradyun Gedam
8c3447e85e
Merge pull request #8440 from uranusjr/yaml-tests 2020-06-24 18:38:59 +05:30
Pradyun Gedam
fb68794188
Merge pull request #8026 from sbidoul/requested-sbi 2020-06-24 18:24:30 +05:30
Paul Moore
b966e1383b
Merge pull request #8482 from uranusjr/new-resolver-union-with-versions
Mark new resolver test failure on extra union
2020-06-24 13:20:13 +01:00
Tzu-ping Chung
95477931b2 Mark new resolver test failure on extra union 2020-06-23 20:45:41 +08:00
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
3a3d1d5afe
Merge pull request #8468 from pfmoore/nr_test_messages
Test message check fixes
2020-06-19 11:01:17 +01:00
Paul Moore
a7e3f8d088 Test message check fixes 2020-06-18 18:05:51 +01:00
Paul Moore
9626dacec5 Some tests need to monkeypatch the new resolver internals 2020-06-18 15:49:18 +01:00
Paul Moore
d287033599
Merge pull request #8394 from pfmoore/nr_conflict_message
Improve the message for "Resolution Conflict" errors
2020-06-18 13:45:51 +01:00
Tzu-ping Chung
fd3a785018
Reduce regex use when not necessary
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2020-06-18 17:15:58 +08:00
Paul Moore
2795742b31 Add handling of inconsistent root requirements 2020-06-17 16:47:04 +01:00
Paul Moore
09d311594e Move error handling to factory.get_installation_error() 2020-06-17 16:44:53 +01:00
Jussi Kukkonen
dd42e7ec25 test server: Don't mask invalid signals on py38
This removes warnings from test output in python 3.8:

  /usr/lib/python3.8/signal.py:60: RuntimeWarning:
  invalid signal number 32, please use valid_signals()
2020-06-16 17:58:44 +03:00
Tzu-ping Chung
5ee2eeda21 Make the failing tests fail 2020-06-15 16:38:10 +08:00
Tzu-ping Chung
9a2527ad09 Rename CFFI for PyPy 2020-06-15 15:47:38 +08:00
Ilan Schnell
0462774be1 add comment about skiping error checking test on Windows 2020-06-15 15:34:37 +08:00
Ilan Schnell
4b6ce4fbe4 add restore re.I flag 2020-06-15 15:34:37 +08:00
Ilan Schnell
2198e2b2ab Update tests/yaml/conflicting_triangle.yml
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2020-06-15 15:34:37 +08:00
Ilan Schnell
599a494945 Update tests/yaml/conflicting_diamond.yml
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2020-06-15 15:34:37 +08:00
Ilan Schnell
f6691c0aca Update tests/yaml/conflict_2.yml
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2020-06-15 15:34:37 +08:00
Ilan Schnell
6e07c0fd82 Update tests/functional/test_yaml.py
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2020-06-15 15:34:37 +08:00
Ilan Schnell
bf3b1859fc add ability to match error messages against regular expressions 2020-06-15 15:34:37 +08:00
Ilan Schnell
e1f007b314 check for stderr regex in linter 2020-06-15 15:34:37 +08:00
Ilan Schnell
f11c6d6cbd on Windows, the errors behave differently 2020-06-15 15:34:36 +08:00
Ilan Schnell
13ce5209b4 add error checks - run circular tests with new resolver 2020-06-15 15:34:36 +08:00
Ilan Schnell
fec4a0dabd update yaml linter 2020-06-15 15:34:36 +08:00
Ilan Schnell
54f350d524 add error checking to yaml test files 2020-06-15 15:34:36 +08:00
Ilan Schnell
982fddf9c0 add checking exit code and stderr message 2020-06-15 15:34:36 +08:00
Ilan Schnell
a45f657f97 add test for double install 2020-06-15 15:34:36 +08:00
Ilan Schnell
2e086eca40 add test case 2020-06-15 15:34:36 +08:00
Ilan Schnell
7dc345386a add huge yaml test (579 packages) going to add more test cases 2020-06-15 15:34:35 +08:00
Ilan Schnell
4d17ec6442 add errors draft 2020-06-15 15:34:35 +08:00
Ilan Schnell
708b675ba7 add test for unavailable version 2020-06-15 15:34:35 +08:00
Ilan Schnell
b2895a5876 add test cases to large.yml 2020-06-15 15:34:35 +08:00
Ilan Schnell
2f884c9379 disable debug output files 2020-06-15 15:34:35 +08:00
Ilan Schnell
ec288fec0e add comment to large.yml 2020-06-15 15:34:35 +08:00
Ilan Schnell
e8bc39274d add test case to install cachecontrol 2020-06-15 15:34:35 +08:00
Ilan Schnell
7b4bfcb03b work around bug in wheel generation for names which have "-" i them 2020-06-15 15:34:35 +08:00
Ilan Schnell
5e707eec4b add large yaml test 2020-06-15 15:34:35 +08:00
Ilan Schnell
ecfaf9fd85 add linter check to ensure version is string 2020-06-15 15:34:34 +08:00
Ilan Schnell
ed3a6bcd62 add triangle conflict test 2020-06-15 15:34:34 +08:00
Ilan Schnell
057cb03990 add fall back test 2020-06-15 15:34:34 +08:00
Ilan Schnell
279bbc7d95 update comments 2020-06-15 15:34:34 +08:00