开发者

distutils: how to include test files in source distribution and not in build?

开发者 https://www.devze.com 2023-03-11 15:09 出处:网络
I have a simple, pure python project th开发者_Go百科at I want to make available with distutils. I have successfully created compressed tar files for the python modules and some license text files. The

I have a simple, pure python project th开发者_Go百科at I want to make available with distutils. I have successfully created compressed tar files for the python modules and some license text files. These are the relevant parts of the setup.py setup argument list:

  packages=['pkgA',
            'pkgA.subpkgA1',
            'pkgA.subpkgA2'],
  requires = ['matplotlib', 'pytest'],
  data_files = [ 'COPYING', 'COPYING.LESSER'],

The only problem is that this also puts the license files in the distribution, directly under sys.prefix. I would like to ship the license files in the source distribution, but not install them when python setup.py install is run. I currently have no MANIFEST.in file and no post build actions.


You don’t have to put anything in data_files. The arguments to distutils.core.setup (py_modules, packages, data_files, etc.) control what will be built and installed; to distribute additional file, use a MANIFEST.in file: http://docs.python.org/dev/distutils/sourcedist#specifying-the-files-to-distribute There you can have your COPYING file, Python files for tests, anything, and they will not be installed.

0

精彩评论

暂无评论...
验证码 换一张
取 消