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 ']'.
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.
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
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.
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.
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.
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.