我正在尝试构建我相当简单的 Python 项目,以便:
dynamic-dynamodb
安装了系统范围的命令- 该命令指向
dynamic_dynamodb.main:main
我的项目如下所示:
.
├── LICENSE
├── MANIFEST.in
├── Makefile
├── README -> README.md
├── README.md
├── dynamic_dynamodb
│ ├── __init__.py
│ ├── dynamic_dynamodb.py
│ └── main.py
├── example-dynamic-dynamodb.conf
├── requirements.txt
└── setup.py
当我在根文件夹中只有一个 Python 文件时,它就可以正常工作了。但是当项目增长时,我不得不拆分代码并将其放入一个模块(即文件夹dynamic_dynamodb
)中。现在我的setup.py
样子是这样的:
""" Setup script for PyPI """
from setuptools import setup, find_packages
setup(name='dynamic-dynamodb',
version='0.3.0-SNAPSHOT',
license='Apache License, Version 2.0',
description='Automatic provisioning for AWS DynamoDB tables',
author='Sebastian Dahlgren',
author_email='sebastian.dahlgren@gmail.com',
url='http://sebdah.github.com/dynamic-dynamodb/',
keywords="dynamodb aws provisioning amazon web services",
platforms=['Any'],
py_modules=['dynamic_dynamodb'],
packages=find_packages('dynamic_dynamodb'),
include_package_data=True,
zip_safe=False,
install_requires=[
'boto >= 2.6.0'
],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python'
],
entry_points={
'console_scripts': [
'dynamic-dynamodb = dynamic_dynamodb.main:main',
]
}
)
问题是,当我使用构建时,python setup.py sdist
我看到以下错误:
file dynamic_dynamodb.py (for module dynamic_dynamodb) not found
有没有人有任何指示可以将我踢向正确的方向?