Open Jackenmen opened 1 year ago
What you're describing could work... I believe we already require namespace packages to be defined explicitly (namespace-packages
) so that might be fine.
(You could also mark schema
as known-third-party
to unblock you though.)
The same behavior is in isort https://github.com/PyCQA/isort/issues/2101
Repro:
I've run into this because I use a
schema
package from PyPI and I have aschema
folder with JSON schemas within the root of the repository which causes ruff to think thatschema
is a package. I think that one way of solving this would be to alter the current heuristic to check for{base}/__init__.py
file and{base}.py
file rather than{base}
directory and{base.py}
file. This may potentially affect namespace packages and I'm not sure there's a good solution for this that doesn't involve explicitly specifying namespace packages.