entry_point with un-satisfied extras_require doesn't throw a DistributionNotFound if you installed your package as a wheel #882
Comments
This was referenced Dec 11, 2016
jaraco
added a commit
that referenced
this issue
Jan 24, 2017
Fix usage of extras when installing via Wheels; resolves #882
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is somewhat-complex, but I think I have a handle on what's going on. I have a project with a
setup.py
that looks like this:The goal of this code is to say "the MSBuild backend requires the
lxml
package". Later, I do the following:The above should load all the backends whose requirements are met (i.e. don't load the MSBuild backend if you don't have lxml). This works fine when the package was not installed as a Wheel, but if it's a Wheel, setuptools tries to actually import the MSBuild backend and raises an
ImportError
instead ofDistributionNotFound
.It appears to be caused by this code, which from my reading says, "If the extras for this requirement are not satisfied, skip this requirement." However, the requirement in this case is
lxml; extra == "msbuild"
(in a non-Wheel installation, it's justlxml
), so pkg_resources is basically saying, "It's ok if you don't have lxml; just try to load the MSBuild backend." Unfortunately, that's the opposite of what I want, and isn't consistent with the docs:I assume "appropriate error message" in the above is supposed to mean a
DistributionNotFound
exception.The text was updated successfully, but these errors were encountered: