Relative imports from Cython files in cuda_core cause duplicate imports
@acosmicflamingo arbeitet bereits daran.
Seit 23.7.2026.
- Vorherrschende Sprache
- Cython
- Sterne
- 3.4k
- Forks
- 329
- Ø Merge
- 1 T. 21 Std.
- Gemergte PRs (30 T.)
- 113
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.