Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing wheel polutes install directory #498

Open
SamWhited opened this issue Nov 13, 2024 · 1 comment · May be fixed by #499
Open

Installing wheel polutes install directory #498

SamWhited opened this issue Nov 13, 2024 · 1 comment · May be fixed by #499
Labels

Comments

@SamWhited
Copy link

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:

pylint-odoo/setup.cfg

Lines 38 to 40 in 6e857c5

[options.data_files]
requirements =
requirements.txt

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
@SamWhited SamWhited added the bug label Nov 13, 2024
@moylop260
Copy link
Collaborator

moylop260 commented Nov 14, 2024

Hi @SamWhited

Thank you for your report!

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

Nevermind... #499

moylop260 added a commit to vauxoo-dev/pylint-odoo that referenced this issue Nov 14, 2024
When installing a wheel the file `<installroot>/requirements/requirements.txt` is created. This appears to have been intentionally introduced to fix OCA#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
```

Fix OCA#498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants