kdave / btrfs-progs

Development of userspace BTRFS tools
GNU General Public License v2.0
562 stars 245 forks source link

libbtrfsutil python bindings not available in pip #310

Open niklasfi opened 4 years ago

niklasfi commented 4 years ago

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 commented 4 years ago

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.

ajgringo619 commented 2 years ago

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

kdave commented 2 years ago

Not yet, sorry.

ajgringo619 commented 2 years ago

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

svartkanin commented 1 year ago

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 commented 3 months ago

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

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?

jpalus commented 3 months ago

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

kdave commented 3 months ago

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

jpalus commented 2 months ago

@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 commented 2 months ago

Thanks, 6.11 published.