Excluding a top-level directory from a setuptools package

后端 未结 7 1947
闹比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:57

    This is what I found in setuptools manual:

    from setuptools import setup, find_packages
    ...
    packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
    

    In my case the following was enough to exclude top-level tests directory:

    packages = find_packages(exclude=["tests.*", "tests"]),
    
    0 讨论(0)
提交回复
热议问题