Skip to content

Commit

Permalink
Drop support for cffi 0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavid committed Sep 30, 2018
1 parent 0b386c6 commit e5e5f26
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,9 @@
import sys
import unittest

# Get cffi major version
try:
import cffi
except ImportError:
cffi_major_version = None
else:
cffi_major_version = cffi.__version_info__[0]

# Import stuff from pygit2/_utils.py without loading the whole pygit2 package
sys.path.insert(0, 'pygit2')
from _build import __version__, get_libgit2_paths
if cffi_major_version == 0:
from _run import ffi, preamble, C_KEYWORDS
ffi.verify(preamble, **C_KEYWORDS)
del sys.path[0]


Expand Down Expand Up @@ -169,6 +158,7 @@ def run(self):
cmdclass['build'] = BuildWithDLLs

extra_args = {
'cffi_modules': ['pygit2/_run.py:ffi'],
'ext_modules': [
Extension('_pygit2', pygit2_exts, libraries=['git2'],
include_dirs=[libgit2_include],
Expand All @@ -177,12 +167,6 @@ def run(self):
],
}

if cffi_major_version == 0:
extra_args['ext_modules'].append(ffi.verifier.get_extension())
else:
extra_args['cffi_modules'] = ['pygit2/_run.py:ffi']


setup(name='pygit2',
description='Python bindings for libgit2.',
keywords='git',
Expand All @@ -195,7 +179,6 @@ def run(self):
long_description=long_description,
packages=['pygit2'],
package_data={'pygit2': ['decl.h']},
setup_requires=['cffi'],
install_requires=['cffi', 'six'],
zip_safe=False,
cmdclass=cmdclass,
Expand Down

0 comments on commit e5e5f26

Please sign in to comment.