1

私のプロジェクトの1つに次の行があり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.6してpython 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
4

1 に答える 1

0

私が見つけた最善の解決策は、ビルドに余分なステップを追加することです....これは残念ですが、それを回避する別の方法はわかりません。

于 2012-06-27T14:09:41.887 に答える