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

btrfs-progs: libbtrfsutil: use package_data member for header files #894

Closed
wants to merge 3 commits into from

Conversation

adam900710
Copy link
Collaborator

[BUG]
Currently with python3.12, the python bindding will always result the following warning:

    [PY]     libbtrfsutil
/usr/lib/python3.12/site-packages/setuptools/_distutils/extension.py:134: UserWarning: Unknown Extension options: 'headers'
  warnings.warn(msg)

[CAUSE]
In the setup.py which specifies the files to be included into the package, we use setuptools::Extension to specify the file lists and include paths.

But there is no handling of Extension::headers member, thus resulting the above warning.

[FIX]
Not an expert in python, but other packages like cffi are all using package_data to include the headers, so just follow them to use package_data member for headers.

Fixes: 87c3fb5 ("libbtrfsutil: update python setup.py for distribution")

Provide at least basic description of the library for pypi.org main
page. It's for libbtrfsutil that mentions the C and python usage.

[ ci skip ]

Issue: kdave#310
Signed-off-by: David Sterba <[email protected]>
@adam900710 adam900710 self-assigned this Sep 20, 2024
@adam900710 adam900710 added this to the v6.11.1 milestone Sep 20, 2024
@adam900710
Copy link
Collaborator Author

Added a new patch to fix the python packaging error.

This mostly reverts the commit 8f1f2e7 ("libbtrfsutil: update
btrfsutil long description").

There is no need to introduce such a drama to create a temporary
pypi-README.md, just reuse the existing one in libbtrfsutil/README.md.

This does not only make the code simpler, but pass CI.

Issue: kdave#310
Fixes: 8f1f2e7 ("libbtrfsutil: update btrfsutil long description")
Signed-off-by: Qu Wenruo <[email protected]>
[BUG]
Currently with python3.12, the python bindding will always result the
following warning:

    [PY]     libbtrfsutil
/usr/lib/python3.12/site-packages/setuptools/_distutils/extension.py:134: UserWarning: Unknown Extension options: 'headers'
  warnings.warn(msg)

[CAUSE]
In the setup.py which specifies the files to be included into the
package, we use setuptools::Extension to specify the file lists and
include paths.

But there is no handling of Extension::headers member, thus resulting
the above warning.

[FIX]
Not an expert in python, but other packages like cffi are all using
`package_data` to include the headers, so just follow them to use
`package_data` member for headers.

Fixes: 87c3fb5 ("libbtrfsutil: update python setup.py for distribution")
Signed-off-by: Qu Wenruo <[email protected]>
@adam900710
Copy link
Collaborator Author

The existing setup.py is a disaster, as it doesn't work for venv builds.

Furthermore it doesn't follow the common python packaging directory hierarchy, it will be much better to do a rework on the build system so that at least venv build can work properly.

@adam900710 adam900710 closed this Sep 20, 2024
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 this pull request may close these issues.

2 participants