Skip to content
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

Make basedmypy and mypy installable at the same time and use a bmypy command #102

Open
DetachHead opened this issue Dec 14, 2021 · 5 comments

Comments

@DetachHead
Copy link
Collaborator

DetachHead commented Dec 14, 2021

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
@DetachHead DetachHead added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Dec 14, 2021
@KotlinIsland KotlinIsland changed the title use a basedmypy command instead of replacing the mypy one Make basedmypy and mypy installable at the same time and use a bmypy command Dec 14, 2021
@DetachHead DetachHead added the p-1 high label Dec 16, 2021
@Zeckie
Copy link

Zeckie commented Dec 23, 2021

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)

@KotlinIsland
Copy link
Owner

pypa/pip#10749

@Zeckie
Copy link

Zeckie commented Feb 8, 2022

pypa/pip#10749

That won't fix this issue, will just give an error when someone tries to install both.

Seems closer to #156

@KotlinIsland
Copy link
Owner

I really think this is impossible, as plugins depend on the mypy package name.

@Zeckie
Copy link

Zeckie commented Feb 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants