Relative imports from Cython files in cuda_core cause duplicate imports
@acosmicflamingo ci sta già lavorando.
Dal 23/7/2026.
- Lingua principale
- Cython
- Stelle
- 3.4k
- Fork
- 329
- Merge medio
- 1g 23h
- PR unite (30g)
- 116
Descrizione
If you have code like
from . import typing
in a .pyx file, and another part of the system does:
from cuda.core.system import typing
it causes the typing module to be imported twice.
The first import places the module in sys.modules as cuda.core.cu13.system.typing, and the second import places the module in cuda.core.system.typing. It means that any isinstance checks on classes in this module will fail.
This is clearly a side effect of the "megapackage" approach handled by _import_versioned_module. It is not clear whether we can address it at that level.
At a minimum, maybe we can write a lint or an AGENT.md rule that relative imports should be avoided from Cython modules.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.