libgit2 / pygit2

Python bindings for libgit2
https://www.pygit2.org/
Other
1.59k stars 383 forks source link

Add python_requires to setup.py #1095

Closed IRDonch closed 2 years ago

IRDonch commented 2 years ago

I noticed today that installing pygit2 with Python 3.6 downloads the sdist rather than a wheel (and subsequently fails to build):

$ ./venv/bin/pip install pygit2
Collecting pygit2
  Downloading pygit2-1.7.0.tar.gz (276 kB)
[...]
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/include -I/tmp/venv/include -I/usr/include/python3.6m -c src/blob.c -o build/temp.linux-x86_64-3.6/src/blob.o
  In file included from src/blob.c:30:0:
  src/blob.h:33:10: fatal error: git2.h: Нет такого файла или каталога
   #include <git2.h>
            ^~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pygit2
Failed to build pygit2
ERROR: Could not build wheels for pygit2 which use PEP 517 and cannot be installed directly

I looked at this repository, and it seems that this project no longer supports Python 3.6. If that's the case, could you add python_requires='>=3.7' to the setuptools.setup call, so that pip won't attempt to install the new versions when running under 3.6?

If it's not too much trouble, it would also be nice if you could yank the 1.7.0 release and release a 1.7.1 with this fix. That way, the existence of 1.7.0 won't break Python 3.6 users who install pygit2 without specifying an upper bound.

hackgoofer commented 2 years ago

This is affecting me also. I would appreciate people take a look!

dsfartgeg commented 2 years ago

Issue affects Python 3.10.0 on Windows, as well.