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

3261 commits

Author SHA1 Message Date
Pradyun Gedam
982aac544e
Merge pull request #8584 from McSinyx/range-unsupported-exc 2020-07-21 13:53:20 +05:30
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