将python pdfkit模块添加到setup.py依赖项

时间:2015-03-22 07:19:44

标签: python django dependency-injection pip dependency-management

我正在创建一个使用pdfkit模块的django应用程序。我已经关注了django的官方网站教程,了解如何打包我的应用程序,以便通过pip install here提供。

我的setup.py

import os
from setuptools import setup

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
    README = readme.read()

# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))

setup(
    name='django-custom-report',
    version='0.1',
    packages=['custom_report'],
    include_package_data=True,
    license='BSD License',  # example license
    description='A simple Django app to custom reports at admin interface '\
    'based on your models.',
    long_description=README,
    url='http://www.example.com/',
    author='Your Name',
    author_email='myemail@mysite.com',
    classifiers=[
        'Environment :: Web Environment',
        'Framework :: Django',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License', # example license
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        # Replace these appropriately if you are stuck on Python 2.
        'Programming Language :: Python :: 2.7',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
    ],
    install_requires=[
        'django>=1.7',
        'pdfkit',
    ]
)

问题是,在我的install_requires上,我不能简单地添加pdfkit,因为它需要一个通过apt-get安装的系统依赖,如下pdfkit here的文档。

所以,问题是: 如何在setup.py上添加依赖项,这需要另一个仅通过apt-get安装的依赖项? (例如:sudo apt-get install wkhtmltopdf

0 个答案:

没有答案
相关问题