Excluding a top-level directory from a setuptools package

后端 未结 7 2002
闹比i
闹比i 2020-12-25 11:02

I\'m trying to put a Python project into a tarball using setuptools. The problem is that setuptools doesn\'t appear to like the way that the source tree was originally setu

7条回答
  •  误落风尘
    2020-12-25 11:33

    We use the following convention to exclude 'tests' from packages.

    setup(
       name="project",
       packages=find_packages(exclude=("tests",)),
       include_package_data=True, 
       test_suite='nose.collector',
    )
    

    We also use MANIFEST.in to better control what include_package_data=True does.

提交回复
热议问题