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

Getting project is in the MYPYPATH. Please remove it. with latest mypy #103

Closed
patrick91 opened this issue Jul 24, 2022 · 3 comments
Closed

Comments

@patrick91
Copy link

Hi there, I've got a PR that tries to update mypy to the latest version on my project but the tests fail with the following error:

strawberry is in the MYPYPATH. Please remove it. 

I'm not sure if there's a way to fix this, I'm not setting the MYPYPATH anywhere.

Full message:

❯ poetry run pytest -x tests/mypy                                                                                                                                                       ─╯
=================================================================================== test session starts ===================================================================================
platform darwin -- Python 3.10.5, pytest-7.1.2, pluggy-1.0.0
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
django: settings: tests.django.django_settings (from ini)
rootdir: /Users/patrick/github/strawberry-graphql/strawberry, configfile: pyproject.toml
plugins: snapshot-0.9.0, anyio-3.6.1, benchmark-3.4.1, emoji-0.2.0, mypy-plugins-1.9.3, asyncio-0.19.0, ddtrace-1.2.3, mock-3.8.2, xprocess-0.19.0, django-4.5.2, cov-3.0.0, aiohttp-1.0.4, flask-1.2.0
asyncio: mode=auto
collected 52 items

tests/mypy/test_create_type.yml 😰

======================================================================================== FAILURES =========================================================================================
____________________________________________________________________________________ test_create_type _____________________________________________________________________________________
/Users/patrick/github/strawberry-graphql/strawberry/tests/mypy/test_create_type.yml:12:
E   pytest_mypy_plugins.utils.TypecheckAssertionError: Invalid output:
E   Actual:
E     /Users/patrick/github/strawberry-graphql/strawberry is in the MYPYPATH. Please remove it. (diff)
E     ../../../../../../private/var/folders/14/9c602b_16c9773hgk2w8r5cr0000gn/T/pytest-mypy-d5ylfr5y/See https://mypy.readthedocs.io/en/stable/running_mypy.html#how-mypy-handles-imports for more info (diff)
@Apakottur
Copy link

There's a few similar issues in the mypy repo, like python/mypy#13214.
Seems like a fix is on the way - python/mypy#13223

@patrick91
Copy link
Author

thanks @Apakottur, I'll close the issue then, hopefully we get a new release of MYPY soon 😊

@patrick91
Copy link
Author

I think this was fixed in the last release of this project 😊 will try it soon

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

No branches or pull requests

2 participants