Skip to content

Commit 492bc5a

Browse files
committed
cffi, do not use deprecated verify()
1 parent dee3741 commit 492bc5a

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.cache/
2+
/.eggs/
23
/.tox/
34
/build/
45
/dist/

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.PHONY: build
2+
3+
build:
4+
python setup.py build_ext --inplace

docs/development.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Unit tests
1515
1616
$ git clone git://github.com/libgit2/pygit2.git
1717
$ cd pygit2
18+
$ python setup.py build_ext --inplace
1819
$ pytest test
1920
2021
Coding style: documentation strings

pygit2/ffi.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,4 @@
2929
from __future__ import absolute_import
3030

3131
# Import from pygit2
32-
try:
33-
from ._libgit2 import ffi, lib as C
34-
except ImportError:
35-
from ._run import ffi, preamble, C_KEYWORDS
36-
C = ffi.verify(preamble, **C_KEYWORDS)
32+
from ._libgit2 import ffi, lib as C

setup.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,11 @@ def run(self):
131131
if os.name == 'nt':
132132
cmdclass['build'] = BuildWithDLLs
133133

134-
extra_args = {
135-
'cffi_modules': ['pygit2/_run.py:ffi'],
136-
'ext_modules': [
137-
Extension('_pygit2', pygit2_exts, libraries=['git2'],
138-
include_dirs=[libgit2_include],
139-
library_dirs=[libgit2_lib]),
140-
# FFI is added in the build step
141-
],
142-
}
134+
ext_modules = [
135+
Extension('_pygit2', pygit2_exts, libraries=['git2'],
136+
include_dirs=[libgit2_include],
137+
library_dirs=[libgit2_lib]),
138+
]
143139

144140
setup(name='pygit2',
145141
description='Python bindings for libgit2.',
@@ -157,4 +153,6 @@ def run(self):
157153
install_requires=['cffi', 'six'],
158154
zip_safe=False,
159155
cmdclass=cmdclass,
160-
**extra_args)
156+
cffi_modules=['pygit2/_run.py:ffi'],
157+
ext_modules=ext_modules,
158+
)

0 commit comments

Comments
 (0)