https://pantsbuild.org/ logo
#general
Title
# general
f

flat-zoo-31952

11/25/2022, 5:27 PM
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

enough-analyst-54434

11/25/2022, 5:28 PM
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

flat-zoo-31952

11/25/2022, 5:31 PM
yeah but why
e

enough-analyst-54434

11/25/2022, 5:31 PM
Are your source roots correct?
I.E.: What does
./pants roots
say?
f

flat-zoo-31952

11/25/2022, 5:32 PM
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

enough-analyst-54434

11/25/2022, 5:32 PM
Yeah - so that's the problem
f

flat-zoo-31952

11/25/2022, 5:33 PM
i want
/avnpkg
i saw it said "root_patterns" but that didn't click in my brain
e

enough-analyst-54434

11/25/2022, 5:33 PM
Ah, right.
f

flat-zoo-31952

11/25/2022, 6:06 PM
that fixed it, thanks 💯
5 Views