所以,我用Python编写了一个程序,其结构如下:
project/
| doc/
| project/
| __init__.py
| other packages
| tests
| __init__.py
| other test files
|
| AllTest.py
| README
| License
| setup.py
我的setup.py
文件如下所示:
from setuptools import setup, find_packages
import sys
# dependencies
INSTALL_REQUIRES = ['numpy>1.0.0',
'matplotlib',
'scipy'
]
setup(name='project',
version='0.9',
author='Some Author',
description = ("Working Project for claculating something"),
packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
install_requires=INSTALL_REQUIRES,
test_suite="AllTest.py",
)
我的AllTest.py
看起来像这样:
import unittest
# run all tests in current dir matching the pattern
#if __name__ == "__main__":
def additional_tests():
return unittest.TestLoader().discover('project/test', pattern='*.py')
我的问题是:如果我在driectory中运行python setup.py install
我有我的项目和setup.py
文件,则会创建一个包含所有文件的新目录build
。在我的{ {1}}只创建了\Python3.x\Lib\site-packages
个文件,.egg
文件的项目有.egg
个文件。
我不确定是否需要做所有这些,或者我犯了一些错误。