basedmypy
basedmypy copied to clipboard
Make basedmypy and mypy installable at the same time and use a bmypy command
the current behavior leads to confusion and annoying behavior from pip, especially when trying to switch between normal mypy and basedmypy
> pip install mypy==0.910
Requirement already satisfied: mypy==0.910 in c:\project\.venv\lib\site-packages (0.910)
> mypy -V
basedmypy 1.1.1
mypy 0.920+dev (ee8a5ca5)
Pip doesn't check if it is clobbering a directory on install pypa/pip/issues/4625
This would involve a significant amount of work to rename all of the modules and imports etc.
Plugins also tend to look at mypy internals (mypy passes it's version number to plugins, but they tend to try and import the internals anyway).
Workaround
Install one or the other with pipx, with a respective --suffix.
> pipx install --suffix="-legacy" mypy
...
> mypy-legacy src
the current behavior leads to confusion and annoying behavior from pip, especially when trying to switch between normal mypy and basedmypy
> pip install mypy==0.910 Requirement already satisfied: mypy==0.910 in c:\project\.venv\lib\site-packages (0.910) > mypy -V basedmypy 1.1.1 mypy 0.920+dev (ee8a5ca5)
Also confusing is that it is reporting mypy 0.920... when mypy version 0.910 is installed
I think this would be clearer:
> bmypy -V
basedmypy 1.1.1 (forked from mypy 0.920+dev)
https://github.com/pypa/pip/issues/10749
That won't fix this issue, will just give an error when someone tries to install both.
Seems closer to #156
I really think this is impossible, as plugins depend on the mypy package name.
How much do plugins interact with the internals of mypy?
Would it be possible to have it install as bmypy, and have a separate, optional package to redirect mypy to bmypy for plugins?
The optional package would have an issue if installed at the same time as mypy, but would then be able to detect the issue (when it sees the other mypy files) and warn the user.