Skip to content

Error de instalación en Python 3.12+ (TypeError: _Finder.find() unexpected argument 'license') #28

Description

@eislasq

🐛 Error de instalación en Python 3.12+ — TypeError: _Finder.find() got an unexpected keyword argument 'license'

Descripción

Al intentar integrar el SDK en un proyecto moderno basado en contenedores, la instalación falla en Python 3.12 y 3.13. El error ocurre durante la fase de compilación del wheel, por una incompatibilidad del setup.py con las versiones actuales de setuptools y la eliminación definitiva de distutils.


Pasos para reproducir

  1. Usar una imagen de Docker python:3.12-slim o superior.
  2. Ejecutar:
   pip install git+https://github.com/lunasoft/sw-sdk-python.git@release/0.0.8.1
  1. El proceso falla con el siguiente stacktrace:
 > [5/6] RUN pip install --no-cache-dir -r requirements.txt:
1.290 Collecting sw-sdk-python@ git+https://github.com/lunasoft/sw-sdk-python.git@release/0.0.8.1 (from -r requirements.txt (line 11))
1.290   Cloning https://github.com/lunasoft/sw-sdk-python.git (to revision release/0.0.8.1) to /tmp/pip-install-emzw78pd/sw-sdk-python_3272b476ce2a4255b417fcce14855fd9
1.294   Running command git clone --filter=blob:none --quiet https://github.com/lunasoft/sw-sdk-python.git /tmp/pip-install-emzw78pd/sw-sdk-python_3272b476ce2a4255b417fcce14855fd9
2.939   Running command git checkout -b release/0.0.8.1 --track origin/release/0.0.8.1
2.944   Switched to a new branch 'release/0.0.8.1'
2.944   branch 'release/0.0.8.1' set up to track 'origin/release/0.0.8.1'.
2.944   Resolved https://github.com/lunasoft/sw-sdk-python.git to commit 8b126490ad317c119f8d14c2071b0e0ff549024b
2.948   Installing build dependencies: started
5.131   Installing build dependencies: finished with status 'done'
5.132   Getting requirements to build wheel: started
5.527   Getting requirements to build wheel: finished with status 'error'
5.530   error: subprocess-exited-with-error
5.530
5.530   × Getting requirements to build wheel did not run successfully.
5.530   │ exit code: 1
5.530   ╰─> [20 lines of output]
5.530       Traceback (most recent call last):
5.530         File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
5.530           main()
5.530         File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
5.530           json_out["return_val"] = hook(**hook_input["kwargs"])
5.530                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5.530         File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
5.530           return hook(config_settings)
5.530                  ^^^^^^^^^^^^^^^^^^^^^
5.530         File "/tmp/pip-build-env-942vh9qk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
5.530           return self._get_build_requires(config_settings, requirements=[])
5.530                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5.530         File "/tmp/pip-build-env-942vh9qk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
5.530           self.run_setup()
5.530         File "/tmp/pip-build-env-942vh9qk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 520, in run_setup
5.530           super().run_setup(setup_script=setup_script)
5.530         File "/tmp/pip-build-env-942vh9qk/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 317, in run_setup
5.530           exec(code, locals())
5.530         File "<string>", line 7, in <module>
5.530       TypeError: _Finder.find() got an unexpected keyword argument 'license'
5.530       [end of output]
5.530
5.530   note: This error originates from a subprocess, and is likely not a problem with pip.
5.726
5.726 [notice] A new release of pip is available: 25.0.1 -> 26.1.1
5.726 [notice] To update, run: pip install --upgrade pip
5.729 error: subprocess-exited-with-error
5.729
5.729 × Getting requirements to build wheel did not run successfully.
5.729 │ exit code: 1
5.729 ╰─> See above for output.
5.729
5.729 note: This error originates from a subprocess, and is likely not a problem with pip.

Comportamiento esperado

La librería debería instalarse sin problemas en entornos con Python 3.12 y 3.13, versiones que actualmente reciben soporte activo de corrección de errores y seguridad.


Entorno

Campo Valor
Python 3.12 / 3.13
Herramienta pip / setuptools
Rama del SDK release/0.0.8.1

Contexto adicional

El proceso de construcción intenta utilizar parámetros que ya no son válidos en el backend de empaquetado actual, como resultado de cambios introducidos en versiones recientes de setuptools y la remoción de distutils de la biblioteca estándar.


Propuesta de solución

Estoy trabajando en un Pull Request para:

  • Modernizar el archivo setup.py
  • Añadir un archivo pyproject.toml mínimo

Esto garantizará compatibilidad con las versiones actuales de Python y preparará el proyecto para Python 3.14 y versiones futuras.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions