簡體   English   中英

distutils不在Windows上安裝package_data

[英]distutils does not install package_data on windows

我在我的項目之一的setup.py有以下行(問題底部的完整腳本):

import os
from distutils.core import setup

# ...

setup(
    # ...
    package_data={
        'mesh.binding': ['templates/*'],
        'mesh.documentation': ['templates/*'],
    },
    # ...
)

這會將mesh/binding/templates的內容安裝到Linux和OS X上的site-packages/mesh/binding/templates目錄中,但在Windows上不會成功。 我如何在Windows上使用它?

我是distutils新手,所以如果我忘記重要的事情,請原諒我。 我正在使用setuptools 0.6python 2.7

相關文件

setup.py

import os
from distutils.core import setup

version = '1.0.0'
try:
    revision = os.environ['REVISION']
except Exception:
    pass
else:
    version = revision

packages = []
for root, dirs, files in os.walk('mesh'):
    if '__init__.py' in files:
        packages.append(root.replace('/', '.'))

setup(
    name='mesh',
    version=version,
    description='A declarative RESTful API framework.',
    author='Jordan McCoy',
    author_email='mccoy.jordan@gmail.com',
    license='BSD',
    url='http://github.com/siq/mesh',
    packages=packages,
    package_data={
        'mesh.binding': ['templates/*'],
        'mesh.documentation': ['templates/*'],
    },
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Software Development :: Code Generators',
        'Topic :: Software Development :: Libraries :: Application Frameworks',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ]
)

MANIFEST.in

recursive-include mesh/binding/templates *.tmpl
recursive-include mesh/documentation/templates *.tmpl
include LICENSE
include requirements.txt
include *.rst
recursive-include tests *.py
recursive-include examples *.rst *.py
include docs/conf.py docs/Makefile
recursive-include docs *.rst
recursive-include docs/_static *.css
recursive-include docs/_templates *.html

我發現最好的解決方案只是在構建過程中增加了一個額外的步驟。。。。。。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM