提交 7e97cf64 编写于 作者: P Paul Moore

Ignore invalid extras

上级 67bf5890
......@@ -181,9 +181,23 @@ class ExtrasCandidate(LinkCandidate):
def get_dependencies(self):
# type: () -> Sequence[InstallRequirement]
# TODO: We should probably warn if the user specifies an unsupported
# extra. We can't do this in the constructor, as we don't know what
# extras are valid until we prepare the candidate. Probably the best
# approach would be to override the base class ``dist`` property, to
# do an additional check of the extras, and if any are invalid, warn
# and remove them from extras. This will be tricky to get right,
# though, as modifying the extras changes the candidate's name and
# hence identity, which isn't acceptable. So for now, we just ignore
# unsupported extras here.
# The user may have specified extras that the candidate doesn't
# support. We ignore any unsupported extras here.
valid_extras = self.extras.intersection(self.base.dist.extras)
deps = [
self.base._make_install_req(str(r))
for r in self.base.dist.requires(self.extras)
for r in self.base.dist.requires(valid_extras)
]
# Add a dependency on the exact base.
# (See note 2b in the class docstring)
......
......@@ -99,6 +99,6 @@ def test_new_resolver_installs_extras(script):
"install", "--unstable-feature=resolver",
"--no-cache-dir", "--no-index",
"--find-links", script.scratch_path,
"base[add]"
"base[add,missing]"
)
assert_installed(script, base="0.1.0", dep="0.1.0")
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册