acsone / setuptools-odoo

A library to help packaging Odoo addons with setuptools. It mainly populates the usual setup.py keywords from the Odoo manifest files.
GNU Lesser General Public License v3.0
41 stars 46 forks source link

Specify python dependency at specific version #37

Closed eLBati closed 5 years ago

eLBati commented 5 years ago

It may happen that some OCA module needs a python package at specific version, different from the latest one.

The real use case: l10n_it_fatturapa needs PyXB==1.2.5, but, when you install it with pip from pypi, PyXB is installed at latest version (1.2.6), which does not work with l10n_it_fatturapa.

Can this be solved by using install_requires in setup.py? Will this file be later overwritten by OCA-git-bot?

Thanks

sbidoul commented 5 years ago

@eLBati this can be done with external_dependencies_override as explained in the documentation.

I really really advise against pinning versions in addons, however, except as a temporary workaround. Because you will force downstream users to use outdated version of libraries and potentially create version conflicts in the future.

sbidoul commented 5 years ago

setup.py will not be overwritten by the oca bot.

sbidoul commented 5 years ago

BTW, see also https://github.com/odoo/odoo/pull/25549 for an upstream solution.

eLBati commented 5 years ago

@sbidoul thanks a lot