btrfs-progs icon indicating copy to clipboard operation
btrfs-progs copied to clipboard

libbtrfsutil python bindings not available in pip

Open niklasfi opened this issue 4 years ago • 10 comments

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?

niklasfi avatar Nov 01 '20 16:11 niklasfi

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 avatar Nov 02 '20 14:11 kdave

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

ajgringo619 avatar Jul 27 '22 19:07 ajgringo619

Not yet, sorry.

kdave avatar Jul 27 '22 19:07 kdave

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

ajgringo619 avatar Jul 27 '22 20:07 ajgringo619

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?

svartkanin avatar Feb 25 '23 04:02 svartkanin