[Fix]: fix mim command crashes problem if requirements version conflict
Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.
Motivation
Fixes #143 that mim could be crash if exist version conflict. For reproduce mim crash:
> pip install markdown==3.3.7
> pip install importlib-metadata==4.2
> mim list
Modification
-
mim/__init__.py: set__requires__in__main__module from 'openmim' to '' avoid requirement resolve check.
BC-breaking (Optional)
Does the modification introduce changes that break the back-compatibility of the downstream repos? If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.
Use cases (Optional)
If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.
Checklist
- Pre-commit or other linting tools are used to fix the potential lint issues.
- The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
- If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
- The documentation has been modified accordingly, like docstring or example tutorials.
Codecov Report
Merging #144 (c8703b7) into main (b449e97) will increase coverage by
0.05%. The diff coverage is100.00%.
@@ Coverage Diff @@
## main #144 +/- ##
==========================================
+ Coverage 54.44% 54.50% +0.05%
==========================================
Files 23 23
Lines 1552 1554 +2
Branches 331 331
==========================================
+ Hits 845 847 +2
Misses 582 582
Partials 125 125
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 54.50% <100.00%> (+0.05%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| mim/__init__.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update b449e97...c8703b7. Read the comment docs.
This workaround works fine, but I'm not sure if good enough to merge into the master branch. Please give this PR a review. @zhouzaida