-
Notifications
You must be signed in to change notification settings - Fork 39
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
feat: add support for pyls-mypy #232
feat: add support for pyls-mypy #232
Conversation
Obviously, it should have been git+https: ... from the start...
What is the state of this? Is it ready for merging? |
Merge with upstream master
@tillhainbach Let me know when this is ready. I can squash the commits to fix the commitlint error. |
Hey, from my point of view the state is as follows: 1. Merge Conflict and CI Tests:I merged my branch with the master branch and resolved the merge conflicts there. However, now there is a new commit-linter in the CI, so the linter-test fails on the old commit messages. I think I could go back and reword all commit messages to the linter's standard but that would be a little tedious. 2. Pyls-Mypy:The owner of the pyls-mypy repo seems to be "off the grid" and the pyls-group is going to take over maintenance for pyls-mpypy (tomv564/pyls-mypy#44). But there hasn't been any progress since last September, as far as I can tell. |
@aminya fixing the commitlint errors would be nice. |
So, how can I test if this is working? Does this automatically work in combination with python-language-server? My test, run a import os
os.chdir() @lgeiger Maybe you can clarify this here. |
If Mypy is enabled in the ide-python settings and pyls-mypy is installed it should work out-of-the-box. I'm not sure how you catch if an error is thrown, but pyls-mypy should throw an error if you do something like this: an_int: int = "1" |
Unfortunately, this doesn't seem to work. The error isn't transmitted to Atom. Is there an additional spawning needed for this? |
@aminya I just remembered that I have set the default configuration for mypy to "live mode -> false" (because of caveats here). I tested it myself like this: # clone repo and checkout new feat branch
gh repo clone tillhainbach/ide-python
cd ide-python
git checkout add-pyls-mypy-support
# link into dev/packages
apm develop ide-python
# install package
apm install
# create test dir with python virtual env
mkdir test_mypy
cd test_mypy
python -m venv venv
. ./venv/bin/activate
# install pyls and pyls-mypy
python -m pip install 'python-language-server[all]'
python -m pip install git+https://github.com/tomv564/pyls-mypy.git
# create python file with type error
echo 'an_int: int = "1"' >> test_mypy_error.py
atom -d .
# no error
# file -> save --> mypy error |
Shouldn't this give an error? I am confused. |
Could you give me a guide, how you would go about testing this/intercepting atom errors? Then I could try it out locally and report back. Is there something like a docker image with a clean atom installation or something? For clarification: |
Set default live-mode to pyls-mypy defaults. Co-authored-by: Amin Yahyaabadi <[email protected]>
Should there be a note something like: "turning live-mode off may result in mypy not working on some machines"? Because apparently this setting seems to be a pit picky? |
Yes, adding a note in the config description would be useful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution!
🎉 This PR is included in version 1.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
No description provided.