Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The official way to get pygit2 for python 3.7 on windows #809

Closed
Predelnik opened this issue Jul 31, 2018 · 5 comments
Closed

The official way to get pygit2 for python 3.7 on windows #809

Predelnik opened this issue Jul 31, 2018 · 5 comments
Labels

Comments

@Predelnik
Copy link

Predelnik commented Jul 31, 2018

Wheels here contain only versions up to 3.6:
https://pypi.org/project/pygit2

pip install pygit2 results in the:

c:\users\prede\appdata\local\temp\pip-install-6zhgzkh3\pygit2\src\blob.h(33): fatal error C1083: Cannot open include file: 'git2.h': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\bin\HostX86\x64\cl.exe' failed with exit status 2

I don't mind supplying libgit2 myself but it's unobvious how to do it.

Is python 3.7 unsupported?

@jdavid
Copy link
Member

jdavid commented Aug 11, 2018

Just added support for Python 3.7, but no release yet.
You can get the artifacts here, https://ci.appveyor.com/project/jdavid/pygit2/build/1.0.268/job/y83kvhg79ca8j23c/artifacts

@jdavid jdavid added the feature label Sep 9, 2018
@jdavid
Copy link
Member

jdavid commented Sep 16, 2018

0.27.2 released, closing

@jdavid jdavid closed this as completed Sep 16, 2018
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Dec 1, 2018
0.27.2 (2018-09-16)
-------------------------

- Add support for Python 3.7
  `#809 <https://github.com/libgit2/pygit2/issues/809>`_

- New ``Object.short_id``
  `#799 <https://github.com/libgit2/pygit2/issues/799>`_
  `#806 <https://github.com/libgit2/pygit2/pull/806>`_
  `#807 <https://github.com/libgit2/pygit2/pull/807>`_

- New ``Repository.descendant_of`` and ``Repository.branches.with_commit``
  `#815 <https://github.com/libgit2/pygit2/issues/815>`_
  `#816 <https://github.com/libgit2/pygit2/pull/816>`_

- Fix repository initialization in ``clone_repository(...)``
  `#818 <https://github.com/libgit2/pygit2/issues/818>`_

- Fix several warnings and errors, commits
  `cd896ddc <https://github.com/libgit2/pygit2/commit/cd896ddc>`_
  and
  `dfa536a3 <https://github.com/libgit2/pygit2/commit/dfa536a3>`_

- Documentation fixes and improvements
  `#805 <https://github.com/libgit2/pygit2/pull/805>`_
  `#808 <https://github.com/libgit2/pygit2/pull/808>`_


0.27.1 (2018-06-02)
-------------------------

Breaking changes:

- Now ``discover_repository`` returns ``None`` if repository not found, instead
  of raising ``KeyError``
  `#531 <https://github.com/libgit2/pygit2/issues/531>`_

Other changes:

- New ``DiffLine.raw_content``
  `#610 <https://github.com/libgit2/pygit2/issues/610>`_

- Fix tests failing in some cases
  `#795 <https://github.com/libgit2/pygit2/issues/795>`_

- Automatize wheels upload to pypi
  `#563 <https://github.com/libgit2/pygit2/issues/563>`_
@arhadthedev
Copy link

The same error appeared again. I have never heard about pygit2 before today, so I cannot pinpoint why and when it started failing.

My environment:

  • Python 3.11.0a2
  • pip 21.3.1
  • git 2.33.1.windows.1 x64 (installed by official Windows Setup)
  • Windows 10
  • Visual Studio 2019 16.11.7
An output for pip install pygit2 (click to expand)
Defaulting to user installation because normal site-packages is not writeable
Collecting pygit2
  Using cached pygit2-1.7.1.tar.gz (281 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cffi>=1.4.0
  Using cached cffi-1.15.0-cp311-cp311-win_amd64.whl
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: pygit2
  Building wheel for pygit2 (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Program Files\Python311\python.exe' 'C:\Program Files\Python311\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C:\Users\oleg\AppData\Local\Temp\tmppjbq6fpj'
       cwd: C:\Users\oleg\AppData\Local\Temp\pip-install-i5s_ugto\pygit2_61fa44418a8946bbbf9d30b8f9f594d1
  Complete output (63 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.11
  creating build\lib.win-amd64-3.11\pygit2
  copying pygit2\blame.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\callbacks.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\config.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\credentials.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\errors.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\ffi.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\index.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\packbuilder.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\refspec.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\remote.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\repository.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\settings.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\submodule.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\utils.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\_build.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\_run.py -> build\lib.win-amd64-3.11\pygit2
  copying pygit2\__init__.py -> build\lib.win-amd64-3.11\pygit2
  creating build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\attr.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\blame.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\buffer.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\callbacks.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\checkout.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\clone.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\commit.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\common.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\config.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\describe.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\diff.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\errors.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\graph.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\index.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\indexer.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\merge.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\net.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\oid.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\pack.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\proxy.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\refspec.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\remote.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\repository.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\revert.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\stash.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\strarray.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\submodule.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\transport.h -> build\lib.win-amd64-3.11\pygit2\decl
  copying pygit2\decl\types.h -> build\lib.win-amd64-3.11\pygit2\decl
  running build_ext
  generating cffi module 'build\\temp.win-amd64-3.11\\Release\\pygit2._libgit2.c'
  creating build\temp.win-amd64-3.11
  creating build\temp.win-amd64-3.11\Release
  building 'pygit2._pygit2' extension
  creating build\temp.win-amd64-3.11\Release\src
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Program Files\libgit2\include -IC:\Program Files\Python311\include -IC:\Program Files\Python311\Include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /Tcsrc\blob.c /Fobuild\temp.win-amd64-3.11\Release\src\blob.obj
  blob.c
  C:\Users\oleg\AppData\Local\Temp\pip-install-i5s_ugto\pygit2_61fa44418a8946bbbf9d30b8f9f594d1\src\blob.h(33): fatal error C1083: Cannot open include file: 'git2.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  ----------------------------------------
  ERROR: Failed building wheel for pygit2
Failed to build pygit2
ERROR: Could not build wheels for pygit2, which is required to install pyproject.toml-based projects

@arhadthedev
Copy link

The issue is solved. I found that pygit2 1.7.1 supports Python not later than 3.10. Did Python broke compatibility of plugin API or a list of target versions is set manually?

@cjolowicz
Copy link
Contributor

@arhadthedev There are no pygit2 wheels for Python 3.11 yet (which is still a pre-release at this time). As a result, pip attempts to build the wheel from the source distribution. You will need to install libgit2 on your system to make this work. It's the C library wrapped by pygit2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants