Context
En Python 3.12, imp ha desaparegut. Ara mateix la suite unitària local falla només importar destral.utils perquè el fitxer fa import imp.
Validació local:
python3 -m unittest discover tests
Resultat observat en Python 3.12:
ModuleNotFoundError: No module named 'imp'
Punt afectat:
destral/utils.py, funció module_exists()
Impacte
La CI actual cobreix Python 3.11 i Python 2.7, però qualsevol entorn local o runner que pugi a Python 3.12 trenca destral abans d'executar tests.
Proposta
- Substituir
imp.find_module per importlib.util.find_spec en Python 3.
- Mantenir fallback compatible amb Python 2.7.
- Afegir test unitari per
module_exists() amb mòdul existent/inexistent.
- Opcional: afegir Python 3.12 a la CI si es vol declarar suport formal.
Context
En Python 3.12,
impha desaparegut. Ara mateix la suite unitària local falla només importardestral.utilsperquè el fitxer faimport imp.Validació local:
Resultat observat en Python 3.12:
Punt afectat:
destral/utils.py, funciómodule_exists()Impacte
La CI actual cobreix Python 3.11 i Python 2.7, però qualsevol entorn local o runner que pugi a Python 3.12 trenca
destralabans d'executar tests.Proposta
imp.find_moduleperimportlib.util.find_specen Python 3.module_exists()amb mòdul existent/inexistent.