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

libbtrfsutil python bindings not available in pip #310

Open
niklasfi opened this issue Nov 1, 2020 · 10 comments
Open

libbtrfsutil python bindings not available in pip #310

niklasfi opened this issue Nov 1, 2020 · 10 comments

Comments

@niklasfi
Copy link

niklasfi commented Nov 1, 2020

The python bindings located in libbtrfsutil/python are not available within the pypi repository. This makes it very complicated for programmers to use them.

Since most of the work is already done (setup.py is included in the repository), it was not that difficult for me to create and upload a pipy package to the testing server using the following Dockerfile:

FROM python:3.8 as build

ARG GIT_BRANCH=master
ARG TWINE_USERNAME
ARG TWINE_PASSWORD

RUN apt update && apt install -y \
        libbtrfsutil-dev \
        patchelf \
    && rm -rf /var/lib/apt/lists/*

RUN pip install setuptools wheel twine auditwheel

RUN git clone --branch "$GIT_BRANCH" --depth 1 https://github.com/kdave/btrfs-progs.git /btrfs-progs/

WORKDIR /btrfs-progs/libbtrfsutil/python
RUN python setup.py sdist bdist_wheel
RUN python -m auditwheel repair dist/btrfsutil-*.whl
RUN python -m twine upload --repository testpypi wheelhouse/btrfsutil-*.whl

The result is available on the pypi testing server.

Is the btrfs-progs project interested in adding python package creation to its ci pipelines? If so, how can I help integrating it?

@kdave
Copy link
Owner

kdave commented Nov 2, 2020

Yes, that sounds great, thanks. I'm not familiar with pypi packaging, so please let me explore that first, but that you did the test build test will sure help.

@kdave kdave changed the title libbtrfs python bindings not available in pip libbtrfsutil python bindings not available in pip Nov 2, 2021
@ajgringo619
Copy link

Did this go anywhere? I've been working with BTRFS and want to use a venv without having to resort to site-packages.

@kdave
Copy link
Owner

kdave commented Jul 27, 2022

Not yet, sorry.

@ajgringo619
Copy link

OK - I'll try to figure out what @niklasfi did, see if I can build my own.

@svartkanin
Copy link

svartkanin commented Feb 25, 2023

I would also be interested in having this available in PyPi, is there an option to raise a PR for this and include it, as suggested by @niklasfi, in the CI build to be published?

@kdave
Copy link
Owner

kdave commented Jul 30, 2024

So, it's there, https://pypi.org/project/btrfsutil/ . Manual upload, got some problems with python packaging and generated files.

  • setup.py is still used for local build (make)
  • for pypi it must be done by 'python3 -m build' that is build in a temporary directory
  • btrfsutilpy.h must be also distributed
  • version is set manually (the git VERSION file is not accessible)
  • the project page metadata is empty, the README.md should be added

I'd appreciate some feedback what else is missing or what should be fixed (and how). I'm not sure about versioning, currently it's 6.10 but there are almost no changes to the python code. Should the python package be versioned separately or in lockstep with whole project despite producing many no-change versions?

kdave added a commit that referenced this issue Jul 30, 2024
Fixes so 'python3 -m build' works and package can be uploaded to pypi
(https://pypi.org/project/btrfsutil/).

- setup.py is still used for local build (make)
- for pypi it must be done by 'python3 -m build' that is build in a
  temporary directory
- btrfsutilpy.h must be also distributed
- version is set manually (the git VERSION file is not accessible)
- the project page metadata is empty, the README.md should be added

Issue: #310
Signed-off-by: David Sterba <[email protected]>
kdave added a commit that referenced this issue Aug 14, 2024
Fixes so 'python3 -m build' works and package can be uploaded to pypi
(https://pypi.org/project/btrfsutil/).

- setup.py is still used for local build (make)
- for pypi it must be done by 'python3 -m build' that is build in a
  temporary directory
- btrfsutilpy.h must be also distributed
- version is set manually (the git VERSION file is not accessible)
- the project page metadata is empty, the README.md should be added

Issue: #310
Signed-off-by: David Sterba <[email protected]>
@jpalus
Copy link

jpalus commented Aug 17, 2024

Note that after these changes setup.py in 6.10.1 release ended up with old version (6.10).

@kdave
Copy link
Owner

kdave commented Aug 20, 2024

Ah right, thanks. I need to update the release checklist.

@jpalus
Copy link

jpalus commented Sep 18, 2024

@kdave just a gentle reminder since 6.11 was still released with 6.10:

https://github.com/kdave/btrfs-progs/blob/v6.11/libbtrfsutil/python/setup.py#L112

@kdave
Copy link
Owner

kdave commented Sep 18, 2024

Thanks, 6.11 published.

kdave added a commit that referenced this issue Sep 18, 2024
[ ci skip ]

Issue: #310
Signed-off-by: David Sterba <[email protected]>
kdave added a commit that referenced this issue Sep 18, 2024
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: #310
Signed-off-by: David Sterba <[email protected]>
adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Sep 20, 2024
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]>
adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Sep 20, 2024
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]>
adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Sep 20, 2024
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]>
adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Sep 21, 2024
…escription

Instead of copying the file during custom build commands, just use a
soft link to re-use the existing README.d from libbtrfsutil.

Issue: kdave#310
Signed-off-by: Qu Wenruo <[email protected]>
adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Sep 21, 2024
…escription

Instead of copying the file during custom build commands, just use a
soft link to re-use the existing README.d from libbtrfsutil.

Issue: kdave#310
Signed-off-by: Qu Wenruo <[email protected]>
adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Sep 21, 2024
…escription

Instead of copying the file during custom build commands, just use a
soft link to re-use the existing README.d from libbtrfsutil.

Issue: kdave#310
Signed-off-by: Qu Wenruo <[email protected]>
adam900710 added a commit to adam900710/btrfs-progs that referenced this issue Sep 21, 2024
…escription

Instead of copying the file during custom build commands, just use a
soft link to re-use the existing README.d from libbtrfsutil.

Issue: kdave#310
Signed-off-by: Qu Wenruo <[email protected]>
adam900710 added a commit that referenced this issue Sep 21, 2024
…escription

Instead of copying the file during custom build commands, just use a
soft link to re-use the existing README.d from libbtrfsutil.

Issue: #310
Signed-off-by: Qu Wenruo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants