-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ModuleNotFoundError: No module named 'mismatch' #4655
Comments
Thanks for letting us know! We'd intended to keep mismatch separate so it could be used and installed separately eventually, but looks like we missed a step about how the files are packaged. Pinging @inosmeet in case he wants to take a look at it. But I'm guessing he's busy so if anyone else wants to take a stab at it, it should take some reading through setup.py to add the file and possibly some reading of the docs on https://packaging.python.org/ |
Hello, Is this issue already been fixed? Because I tried running mismatch on my editable version and it worked fine I believe
So I tried normal pip version of |
@Prtm2110 That's expected! When you use an editable version you're usually installing from github and have 100% of the files. When we build the package for pip, we only include a subset of files needed to run the software. That mostly means we don't install the tests and the testing files, which is especially important in our case because our testing files include a bunch of things that "look vulnerable" because they have the names of old components in them. And also it's approximately a thousand files that most people don't need or want unless they intend to do development. The bug here is that we need to add the mismatch directory into If you're thinking about fixing it, you can follow the instructions on https://packaging.python.org/ to build and test a package locally even though you can't upload to pypi yourself. |
Thank you for such a detailed response!
I wasn't quite aware of this, I have now added it to
|
Description
Currently an entrypoint is defined that creates a console script called
mismatch
.This tries to call the module
mismatch.cli
but since it isn't installed it fails with an error.https://github.com/intel/cve-bin-tool/blob/main/setup.py#L75
The docs explain how to run mismatch "manually" and this works for me: https://github.com/intel/cve-bin-tool/blob/main/doc/mismatch_data.md
Looking at the code it would make more sense to move
mismatch.cli
intocve_bin_tool
(like withcsv2cve
) to avoid having to provide it as a separate package.To reproduce
Steps to reproduce the behaviour:
pip install cve-bin-tool
mismatch
command:mismatch
Expected behaviour:
mismatch runs successfully as if calling
python -m cve_bin_tool.mismatch_loader
Actual behaviour:
Version/platform info
Python 3.13.1 running in the official python docker image.
The text was updated successfully, but these errors were encountered: