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
strict-imports toggle doesn't seem to work when run by pre-commit #113
Comments
I'll have a look 👀 |
@Goldziher I did some digging...I don't think the
What I think may be the issue instead is the fact that |
Hi, they happen on all dependencies. I will add a branch later and send you a link here so you can see. |
Ok, here is a branch in our repo: https://github.com/starlite-api/starlite/tree/demonstrate-slots-check-issue Simply clone it and execute This will fail completely, so to "fix" it you will need to update the - repo: https://github.com/ariebovenberg/slotscheck
rev: v0.14.1
hooks:
- id: slotscheck
exclude: "test_*"
additional_dependencies:
[
aiomcache,
brotli,
cryptography,
httpx,
jinja2,
mako,
orjson,
piccolo,
picologging,
pydantic,
pydantic_factories,
pydantic_openapi_schema,
pytest,
pyyaml,
redis,
sqlalchemy,
starlette,
starlite_multipart,
structlog,
tortoise_orm,
] Which includes all the above dependencies, which are supposed to be ignored. |
@Goldziher thanks for taking the time to share your setup. The problem is indeed that not all import errors are ignored. In short, Solution is of course to gracefully handle these as well (if |
@Goldziher alright, the pending PR should fix this. You can try it yourself by using the tag |
@Goldziher this issue got auto-closed with the PR. Feel free to re-open if it doesn't solve your issue. edit: the fix is now out in version 0.16.0 on PyPI |
Cheers |
Hi,
I tried configuring
no-strict-imports
i pyproject.toml, but running the tool via pre-commit ignored this completely. I concluded it probably doesn't read the pyproject.toml file inside pre-commit, so I insterad tried doing this in my pre-commit config:But the tool keeps complaining about imports. I think it simply doesn't pick the config.
The text was updated successfully, but these errors were encountered: