From 01b69f31b613a99f2a5d47c96fde12b2d0c497d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Sat, 6 Apr 2019 13:14:51 +0200 Subject: [PATCH] Work with pycparser 2.18 and 2.19 Fixes #846 --- pygit2/__init__.py | 5 ++--- pygit2/remote.py | 5 ++--- setup.py | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) Index: pygit2-0.28.0/pygit2/__init__.py =================================================================== --- pygit2-0.28.0.orig/pygit2/__init__.py +++ pygit2-0.28.0/pygit2/__init__.py @@ -153,8 +153,7 @@ def init_repository(path, bare=False, # Ok return Repository(to_str(path)) -@ffi.callback('int (*git_repository_create_cb)(git_repository **out,' - 'const char *path, int bare, void *payload)') +@ffi.callback('int (*cb)(git_repository **out, const char *path, int bare, void *payload)') def _repository_create_cb(repo_out, path, bare, data): d = ffi.from_handle(data) try: @@ -168,7 +167,7 @@ def _repository_create_cb(repo_out, path return 0 -@ffi.callback('int (*git_remote_create_cb)(git_remote **out, git_repository *repo,' +@ffi.callback('int (*cb)(git_remote **out, git_repository *repo,' 'const char *name, const char *url, void *payload)') def _remote_create_cb(remote_out, repo, name, url, data): d = ffi.from_handle(data) Index: pygit2-0.28.0/pygit2/remote.py =================================================================== --- pygit2-0.28.0.orig/pygit2/remote.py +++ pygit2-0.28.0/pygit2/remote.py @@ -291,7 +291,7 @@ class RemoteCallbacks(object): return 0 - @ffi.callback('int (*credentials)(git_cred **cred, const char *url,' + @ffi.callback('int (*cb)(git_cred **cred, const char *url,' 'const char *username_from_url, unsigned int allowed_types,' 'void *data)') def _credentials_cb(cred_out, url, username, allowed, data): @@ -312,8 +312,7 @@ class RemoteCallbacks(object): return 0 - @ffi.callback('int (*git_transport_certificate_check_cb)' - '(git_cert *cert, int valid, const char *host, void *payload)') + @ffi.callback('int (*cb)(git_cert *cert, int valid, const char *host, void *payload)') def _certificate_cb(cert_i, valid, host, data): self = ffi.from_handle(data) Index: pygit2-0.28.0/setup.py =================================================================== --- pygit2-0.28.0.orig/setup.py +++ pygit2-0.28.0/setup.py @@ -154,7 +154,7 @@ setup(name='pygit2', packages=['pygit2'], package_data={'pygit2': ['decl.h']}, setup_requires=['cffi'], - install_requires=['cffi', 'six', 'pycparser<2.18'], + install_requires=['cffi', 'six', 'pycparser'], zip_safe=False, cmdclass=cmdclass, **extra_args)