Setup.py安装不能按预期工作???或者是吗?

时间:2014-12-15 14:24:00

标签: python-3.x setuptools setup.py

所以,我用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个文件。

我不确定是否需要做所有这些,或者我犯了一些错误。

0 个答案:

没有答案