Reputation: 15308
I'm writing a setup.py
script and want to specify a dependency onto MySQL package:
requires=['requests', 'mock', 'GitPython', 'MySQL-python']
But MySQL-python
looks to be illegal for setup tool because it thinks that after -
there should be a version and it throws this error:
ValueError: expected parenthesized list: '-python'
What can I do here?
Environment: Python 2.7.3; precise 32
Upvotes: 5
Views: 465
Reputation: 6907
On this point you should not follow the distutils documentation. requires
comes from a PEP defining metadata for distributions, but it does not actually work with any tool, including distutils. For now, you need to choose a packaging tool that’s not in the standard library and use its conventions for defining dependencies and build-time dependencies. pip has requirements files; distribute has requires_dist and setup_requires; buildout has something else, etc.
Upvotes: 0
Reputation: 2799
From the distutils documentation:
To specify that any version of a module or package is required, the string should consist entirely of the module or package name. Examples include 'mymodule' and 'xml.parsers.expat'.
With that in mind you should just be able to check off MySQL-python's _mysql
module:
requires=['requests', 'mock', 'GitPython', '_mysql']
Upvotes: 1