我将include_package_data=True
与setuptools
一起使用。
尽管运行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 *
答案 0 :(得分:1)
我在使用此MANIFEST.in
时遇到了相同的问题:
include setup.json
recursive-include . *.coffee
.coffee
文件存在于.tar.gz文件中,但尚未安装zip_safe=False
recursive-include
切换到单个include
来解决了
正在使用
答案 1 :(得分:0)
需要使用zip_safe=False
标志来防止在ZIP文件中进行安装。