OCA / pylint-odoo

Odoo plugin for Pylint
http://www.pylint.org
143 stars 168 forks source link

Installing wheel polutes install directory #498

Open SamWhited opened 2 weeks ago

SamWhited commented 2 weeks ago

Module

pylint-odoo

Describe the bug

When installing a wheel the file <installroot>/requirements/requirements.txt is created. This appears to have been intentionally introduced to fix #440 by introducing the following lines to setup.cfg:

https://github.com/OCA/pylint-odoo/blob/6e857c52117ef8597e0433b32ca6fac302ea76b8/setup.cfg#L38-L40

However, this is not the correct format for adding files (they should be an array of (path, file) tuples), resulting in a directory called "/requirements" that will contain the file, likely not what we want.

It is unclear to me how source tarballs were being generated before, because requirements.txt should always be included when building with setuptools.

To Reproduce

Steps to reproduce the behavior:

$ python -m venv venv
$ source venv/bin/activate
$ pip install build installer wheel
…
$ python -m build --wheel
…
$ python -m installer dist/pylint_odoo-9.1.3-py3-none-any.whl
$ ls venv/requirements/
requirements.txt

This is especially a problem for downstream OS packagers who will be installing the package to the (virtual) root directory as you won't want your final OS package creating /requirements.

Expected behavior

No files are installed outside of the normal filesystem.

As far as I can tell this configuration can be removed from setup.cfg entirely. Alternatively, using package data is likely what was actually desired here (though, again, I don't see how it would be necessary in this case, building without this config results in requirements.txt being included for me):

[options.package_data]
pylint-odoo =
    requirements.txt
moylop260 commented 2 weeks ago

Hi @SamWhited

Thank you for your report!

Do you have planned to create the PR with the fix and unittest?

Nevermind... https://github.com/OCA/pylint-odoo/pull/499