Create data files in pip3 editable install mode

Viewed 338

I'm trying to install python package in editable mode with:

pip3 install -e ./

setup.py file contains:

data_files=[
    (os.path.expanduser("~") + "/.xxx", ["xxx/yyy.data"])
],

After installation the yyy.data file is not copied to .xxx folder.

Is there an option to create data files outside of the package folder when working in editable mode?

1 Answers

The truth is data_files has caveats. See No single, complete solution for packaging data issue on the list of Problems in Python Packaging, note in data_files section of Packaging and Distributing Project tutorial from Python Packaging User Guide, pip's bug All packages that contain non-package data are now likely installed in a broken way since 7.0.0 and wheel's bug bdist_wheel makes absolute data_files relative to site-packages.

According to information gathered from above sources your data was installed into site-packages directory instead of your home directory as you were expecting.

Related