include_package_data = True不起作用

时间:2018-08-25 00:57:13

标签: python python-3.x setuptools

我将include_package_data=Truesetuptools一起使用。

尽管运行include_package_data=True时我有python setup.py install,但我的*.xml*.ttl(及其他)文件没有安装。

我的错误是什么?还是setuptools的错误?该怎么办?

来自https://github.com/vporton/xml-boiler setup.py

from coverage.annotate import os
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py as DistutilsBuild


class MyBuild(DistutilsBuild):
    def run(self):
        DistutilsBuild.run(self)
        os.system('make')


setup(
    name='xml-boiler',
    version='0.0.2',
    url='https://github.com/vporton/xml-boiler',
    license='AGPLv3',
    author='Victor Porton',
    author_email='porton@narod.ru',
    description='Automatically transform between XML namespaces',

    use_scm_version=True,
    setup_requires=['setuptools_scm'],
    packages=find_packages(),
    # package_data={'': ['**/*.xml', '**/*.ttl', '**/*.net', 'data/assets/*', 'data/scripts/*.xslt',
    #                    'xmlboiler/doc/*.html', 'xmlboiler/doc/*.css']},
    include_package_data=True,
    scripts=['bin/boiler'],
    # Does not work for non-root install:
    # data_files = [
    #     ('/etc/xmlboiler', ['etc/config-cli.ttl'])
    # ],
    test_suite="xmlboiler.tests",

    cmdclass={'build_py': MyBuild},
)

这是我的MANIFEST.in

recursive-include xmlboiler *.xml *.ttl *.xslt
recursive-include xmlboiler/core/data/assets *

2 个答案:

答案 0 :(得分:1)

我在使用此MANIFEST.in时遇到了相同的问题:

include setup.json
recursive-include . *.coffee
  • .coffee文件存在于.tar.gz文件中,但尚未安装
  • 通过添加zip_safe=False
  • 不能 解决问题 通过从recursive-include切换到单个include解决了

正在使用

  • 车轮0.32.3
  • twine 1.12.1
  • setuptools 39.2.0

答案 1 :(得分:0)

需要使用zip_safe=False标志来防止在ZIP文件中进行安装。