You are not logged in.

#1 2023-01-12 17:10:46

LukeLabrie
Member
Registered: 2022-02-19
Posts: 28

PKGBUILD for python package with version-specific dependencies

I'm writing a PKGBUILD (first time) for CAD_to_OpenMC. The dependencies are listed in the requirements.txt file in the root directory. All have versions available via yay or pacman, and I was therefore using this file as a guideline for my depends() function. However, the requirements.txt file is version specific, which I cannot specify when getting these requirements via yay or pacman. The package is however available via pip. My question is, can I satisfy these requirements in my PKGBUILD if I just use the python wheel as the source? Would the proper dependencies be built into the wheel?

Basically, if I list the dependencies in my PKGBUILD as they are in the requirements.txt file, makepkg won't be able to run without them installed on the system. However, the versions that I could install on my system via yay or pacman would not be the right ones.

Let me know if I can clarify.

Thanks,
Luke

Offline

#2 2023-01-12 18:53:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: PKGBUILD for python package with version-specific dependencies

LukeLabrie wrote:

... which I cannot specify when getting these requirements via yay or pacman

Why not?  You can specify version in the depends array of a PKGBUILD.  The pyparsing module, at least, is available in the AUR in the version you need.  Although it seems odd that the software uses python3, yet claims to need python2 modules... perhaps they've just not updated their requirements.txt.

Last edited by Trilby (2023-01-12 18:54:55)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-01-12 19:16:10

LukeLabrie
Member
Registered: 2022-02-19
Posts: 28

Re: PKGBUILD for python package with version-specific dependencies

When I put in the requirement logic in the depends() function it fails to resolve. Cadquery for example requires 2.2.0, and the AUR has 2.2.1. I tried to install via pip and run makepkg again but that didn't work. I ended up getting around this by writing it in a similar way to the PKGBUILD for cython, which doesn't explicitly list dependencies, and just builds with python -m build --wheel.... not sure if this is contrary to AUR guidelines

Offline

#4 2023-01-13 11:10:34

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 13,033

Re: PKGBUILD for python package with version-specific dependencies

You have looked at https://wiki.archlinux.org/title/Python … guidelines ?

If not, please do (especially section 4.1) .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB