Pip: data_files not consistently being copied at upgrade

Created on 30 Mar 2018  路  8Comments  路  Source: pypa/pip

  • Pip version 9.0.1
  • Python version: 3.5
  • Operating system: debian stretch

Description:

PIP seems to delete data_files on upgrade when those same files already exist, but works with --no-cache-dir option.

I've overridden the cmdclass install as to provide a pre-install check, but haven't explored that option to the end.

What I've run:

`pip install <package>`

* All is well

`pip install --upgrade <package>`

* All data files are missing as well as the directories. Seemed to have deleted files when existing files present

`pip install --no-cache-dir <package>`

Data files are back

auto-locked support

All 8 comments

What is the exact package your trying to install?

It's my own. modislock.

data_files=[('/etc/supervisor/conf.d', ['deploy/modis_admin.conf']), ('/etc/nginx/sites-available' ['deploy/admin_site']), ('/etc/nginx/sites-available', ['deploy/supervisord_site']), ('/etc/nginx/sites-available', ['deploy/admin_site_demo'])]
Yes, they are being copied to protected areas. Raised priviledges are used to install.

With --verbose option I do see a "Files already exist" message scroll by. When going to the directory after a normal upgrade, the files are missing. With --no-cache-dir the files are where they should be.

Two issues that I can see:

  • absolute paths in data_files are not supported by the wheel format
  • all those things you do when overriding the install command will only happen when installing from source, not from subsequent installs from the cached wheel

Really, it looks like what you're after is creating a distribution package, not a Python package (setuptools/wheel/pip is not suited for that).

See #4993 for a similar issue.

You might be right. I am pushing things to the limit of what setuptools can do. I'll look into building a distro package. Thank you very much for responding.

Closing since OP's concerns seem to have been addressed. Thanks @benoit-pierre.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings