Copying setup.py Dependencies with Tox

一世执手 提交于 2019-12-02 02:19:51

Turns out it's not a tox problem, but a setuptools one (or rather, me not using it correctly). I'm posting the answer here just in case somebody else runs into similar problems in the future.

tox creates a source distribution (i.e. python setup.py sdist), and then installs it in a virtual environment, where it then runs the tests. It's this distribution that's missing the VERSION and README.md files, because setuptools doesn't include any non-standard files by default. To wit:

# create a source distribution
$ python setup.py sdist

# extract it
$ cd dist/
$ tar xfz package-0.1.0.tar.gz

# check it out
$ ls package-0.1.0
package    package.egg-info   PKG-INFO   setup.cfg   setup.py

# no VERSION or README.md :(

To include non-standard files, add a MANIFEST.in file like this:

include VERSION
include README.md

Which tells setuptools to include these files in the distribution, and makes tox work as expected.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!