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

[REM] pylint_odoo: Remove requirements/requirements.txt from build #499

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

moylop260
Copy link
Collaborator

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:

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 #498

Credits to @SamWhited

@moylop260
Copy link
Collaborator Author

@SamWhited

Could you check the red CID status, please?

@SamWhited
Copy link

I'm not going to be super useful here as I don't know anything about pytest. Doesn't appear to be related though, looks like it's complaining about some flag you're passing to the code coverage tool?

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
Remove the warning:
 - "This is unnecessary as this plugin provides the more complete --cov-context option."
@moylop260 moylop260 merged commit bdf6d90 into OCA:main Dec 16, 2024
22 checks passed
@moylop260 moylop260 deleted the rm-build-req-moy branch December 16, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Installing wheel polutes install directory Failure when installing from source
2 participants