This feels odd, seems like i've named modules "typ...
# general
f
This feels odd, seems like i've named modules "types" before, and it's worked:
Copy code
12:25:09.08 [ERROR] 1 Exception encountered:

  ProcessExecutionFailure: Process 'Determine Python dependencies for avnpkg/avnpkg/types.py' failed with exit code 1.
stdout:

stderr:
Traceback (most recent call last):
  File "/tmp/pants-sandbox-kPx7dX/./__parse_python_dependencies.py", line 11, in <module>
    import ast
  File "/usr/lib64/python3.9/ast.py", line 29, in <module>
    from contextlib import contextmanager, nullcontext
  File "/usr/lib64/python3.9/contextlib.py", line 6, in <module>
    from functools import wraps
  File "/usr/lib64/python3.9/functools.py", line 22, in <module>
    from types import GenericAlias
  File "/tmp/pants-sandbox-kPx7dX/types.py", line 2, in <module>
    from dataclasses import dataclass
  File "/usr/lib64/python3.9/dataclasses.py", line 1, in <module>
    import re
  File "/usr/lib64/python3.9/re.py", line 124, in <module>
    import enum
  File "/usr/lib64/python3.9/enum.py", line 2, in <module>
    from types import MappingProxyType, DynamicClassAttribute
ImportError: cannot import name 'MappingProxyType' from partially initialized module 'types' (most likely due to a circular import) (/tmp/pants-sandbox-kPx7dX/types.py)
1
e
Attempting to re-purpose a stdlib name is fraught with peril: https://docs.python.org/3/library/types.html Not sure how you were not burned before.
So, is your types
avnpkg.types
?
That should be fine since it lives in the `avnpkg`and then perhaps points to a bug. Maybe in your source roots?
The `/tmp/pants-sandbox-kPx7dX/types.py`says your
types
is top level and not nested in the
avnpkg
.
f
yeah but why
e
Are your source roots correct?
I.E.: What does
./pants roots
say?
f
Copy code
❯ ./pants roots
12:32:35.95 [INFO] Initialization options changed: reinitializing scheduler...
12:32:36.22 [INFO] Scheduler initialized.
.
avnpkg
avnpkg/avnpkg
ah makes sense
e
Yeah - so that's the problem
f
i want
/avnpkg
i saw it said "root_patterns" but that didn't click in my brain
e
Ah, right.
f
that fixed it, thanks 💯