2

I have a project that depends on the pygit2 library. The pygit2 library in turn depends on the locally installed libgit2 and both have to match the minor-version: https://www.pygit2.org/install.html#version-numbers

In my requirements.txt I've specified the dependency as pygit2==0.27.2 because I have libgit2 in version 0.27.x on my system. On other systems different versions of libgit2 might be installed. How can I specify the dependency to match the locally installed version?

Is this even possible with pip or is this a task to be done with distutils and a setup.py?

white_gecko
  • 4,808
  • 4
  • 55
  • 76
  • 1
    You can't. What you can do is build a fat wheel that includes own copy of `libgit2.so` and lots of other libraries (at least `libssh2.so` and `libcurl.so` AFAIK). Especially if built in compliance with PEP 513 (a "manylinux1" wheel), it can be installed on most Linux distros and doesn't need `libgit2` to be installed anymore. – hoefling Dec 14 '18 at 18:11
  • @hoefling would this also work for other platforms? – white_gecko Dec 19 '18 at 15:12
  • 1
    You can build fat wheels for other platforms/OSes too; you will need all the target platforms available for building though (e.g. you can build a `linux_aarch64` wheel with cross compiling, but a `macosx_10_6_intel` wheel can be built on MacOS only etc). – hoefling Dec 19 '18 at 15:44
  • 1
    https://github.com/libgit2/pygit2/pull/869 is going to solve GNU/Linux wheels... – webknjaz -- Слава Україні Feb 11 '19 at 19:59

0 Answers0