Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Usage of "provides" keyword-argument in python's setup.py

I am working on a fork of a python projet (tryton) which uses setuptools for packaging. I am trying to extend the server part of the project, and would like to be able to use the existing modules with my fork.

Those modules are distributed with setuptools packaging, and are requiring the base project for installation.

I need a way to make it so that my fork is considered an acceptable requirement for those modules.

EDIT : Here is what I used in my setup.py :

from setuptools import setup

setup(
    ...
    provides=["trytond (2.8.2)"],
    ...
)

The modules I want to be able to install have those requirements :

from setuptools import setup

setup(
    ...
    install_requires=["trytond>=2.8"]
    ...
)

As it is, with my package installed, trying to install a module triggers the installation of the trytond package.

like image 546
giovanni Avatar asked Sep 10 '13 13:09

giovanni


2 Answers

Don’t use provides, it comes from a packaging specification (a metadata PEP) that is not implemented by any tool. The requiremens in the install_requires argument map to the name in your other setup.py. IOW, replace your provides with setup(name='trytond', version='2.8.2').

like image 59
merwok Avatar answered Oct 04 '22 16:10

merwok


If you are building rpms, it is possible to use the setup.cfg as follows:

[bdist_rpm]
provides = your-package  =    0.8
obsoletes = your-package
like image 36
Thomas Avatar answered Oct 04 '22 15:10

Thomas