Hi Everyone :slightly_smiling_face: do you know if...
# general
e
Hi Everyone 🙂 do you know if this error comes from pants “stdout=“Package myproject appears to be a ‘namespace package’ (see PEP 420), which is not currently supported. If this is not deliberate, adding an init.py file should fix the problem.\n” I’m trying to add a new linter, but I’m not sure if the error comes from the linter or from pants itself
b
Do you have more output to share?
Grepping Pants for this error shows no hits. Is this from
pytest
?
h
That's an error from
lint-imports
AFAICT: https://github.com/seddonym/import-linter/issues/93
I'm guessing that you're getting this error because a
__init__.py
(I think the root package-level one) is missing in the sandbox (which you can confirm by running with
--no-process-cleanup
and looking in the sandbox)
Are you running with
[python-infer].inits
turned on? https://www.pantsbuild.org/docs/reference-python-infer#section-inits
This shouldn't be necessary if your ancestor
__init__.py
files are empty
Or maybe your code under linting truly doesn't have that
__init__.py
, in which case, add one... 🙂
2
e
It seems to me that I’ve already added one 😕 But I’ll retry in the light of the last advice you gave to me
even by adding the init file in my unit test it doesn’t work.
I’ve opened this PR https://github.com/pantsbuild/pants/pull/14648 with the code that I have. If you have a moment to check it, and maybe help me to debug it it would be amazing 🙂
🙌 1
👀 1