Sunday, 21 October 2018

Tox can't copy non-python file while installing the module

This is the tree structure of the module I'm writing the setup.py file for:

ls .

LICENSE
README.md
bin
examples
module
scratch
setup.py
tests
tox.ini

I configured my setup.py as follows:

from setuptools import setup, find_packages

setup(
    name="package_name",
    version="0.1",
    packages=find_packages(),

    install_requires=[
        # [...]
    ],

    extras_require={
        # [...]

    },

    tests_require={
        'pytest',
        'doctest'
    },

    scripts=['bin/bootstrap'],

     data_files=[
        ('license', ['LICENSE']),
     ],

    # [...]
    # could also include long_description, download_url, classifiers, etc.
)

If I install the package from my python environment (also a virtualenv)

pip install .

the LICENSE file gets correctly installed.

But running tox:

[tox]
envlist = py27, py35

[testenv]
deps = 
    pytest
    git+https://github.com/djc/couchdb-python
    docopt

commands = py.test \
    {posargs}

I get this error:

running install_data
  creating build/bdist.macosx-10.11-x86_64/wheel/leafline-0.1.data
  creating build/bdist.macosx-10.11-x86_64/wheel/leafline-0.1.data/data
  creating build/bdist.macosx-10.11-x86_64/wheel/leafline-0.1.data/data/license
  error: can't copy 'LICENSE': doesn't exist or not a regular file

Removing the data_files part from the setup.py makes tox running correctly.



from Tox can't copy non-python file while installing the module

No comments:

Post a Comment