How to specify dependencies when creating the setup.py file for a python package -


the python doc "writing setupscript (http://docs.python.org/2/distutils/setupscript.html) mentions dependencies can specified under section

> 2.4. relationships between distributions , packages

[...] these relationships can specified using keyword arguments distutils.core.setup() function.

dependencies on other python modules , packages can specified supplying requires keyword argument setup(). value must list of strings. each string specifies package required, , optionally versions sufficient.

to specify version of module or package required, string should consist entirely of module or package name. examples include 'mymodule' , 'xml.parsers.expat'.

[...]

given rather sparse information without example want make sure right. also, cannot find requires parameter in api description http://docs.python.org/2/distutils/apiref.html#distutils.core.setup

so done this,e.g.,

setup(name='mystuff',       version='1.0',       requires='os, sys, progressbar',       [...] 

i hope 1 can give me little bit more insight! thanks!

edit:

to address distutils.core, setuptools controversy, 1

try:     setuptools import setup except importerror:     distutils.core import setup 

does make sense?

ignore distutils. if want create package specifies dependencies tool pip go out , find you, need base setup.py of off setuptools instead.

setuptools dependencies listed in install_requires, takes list:

setup(name='mystuff',       version='1.0',       install_requires=['progressbar'],       # ... ) 

which should distributions of own. os , sys modules included python , should not listed.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -