Ben*_*ey4 10 python packaging setup.py
我有这个项目:
.
??? django_mysetup
? ??? __init__.py
? ??? template-basket
? ? ??? apple
? ? ??? app_template
? ? ? ??? forms.py
? ? ? ??? __init__.py
? ? ? ??? models.py
? ? ? ??? tests.py
? ? ? ??? views.py
? ? ??? project_template
? ? ??? manage.py
? ? ??? project_name
? ? ??? __init__.py
? ? ??? settings.py
? ? ??? urls.py
? ? ??? wsgi.py
? ??? templates
? ??? example_direct.html
? ??? example.html
? ??? stylesheets
? ??? base.css
? ??? layout.css
? ??? skeleton.css
??? MANIFEST.in
??? README.rst
??? setup.py
Run Code Online (Sandbox Code Playgroud)
这是setup.py文件:
from distutils.core import setup
setup(
name='Django_mysetup',
py_modules=['django_mysetup'],
entry_points={
'console_scripts': ['django_mysetup = django_mysetup:main', ],},
description='A Personalised Django startproject and startapp setup script.',
long_description=open('README.rst').read(),
packages=['django_mysetup'],
package_data={'django_mysetup': ['templates/*', 'templates/stylesheets/*',
'template-basket/apple/app_template/*',
'template-basket/apple/project_template/*',
'template-basket/apple/project_template/project_name/*',
'template-basket/apple/project_template/manage.py'
]}
)
Run Code Online (Sandbox Code Playgroud)
这是MANIFEST.in文件(MANIFEST生成模板)
include README.rst
recursive-include template-basket *
recursive-include templates *
Run Code Online (Sandbox Code Playgroud)
当我python setup.py sdist和我的virtualenv pip install的*.tar.gz文件,我得到这个:
error: can't copy 'Django-mysetup/templates/stylesheets': doesn't exist or not a regular file
Run Code Online (Sandbox Code Playgroud)
所以问题在于package_data.
如何调整我的setup.py脚本,以便在我的虚拟环境中安装所有内容template-basket和templatesdirs?(最好是我不需要在这些目录中写下每个文件,只是顶部的dir名称.)
| 归档时间: |
|
| 查看次数: |
9578 次 |
| 最近记录: |