From acca2726dfd463f027152870f7e2d7527bf15631 Mon Sep 17 00:00:00 2001 From: Ron Cohen Date: Thu, 21 Aug 2014 18:42:27 +0200 Subject: [PATCH] BuildWithDLLs now inherits from CFFIBuild to *theoretically* fix windows. --- setup.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/setup.py b/setup.py index 477f575..f53a84a 100644 --- a/setup.py +++ b/setup.py @@ -102,8 +102,20 @@ class TestCommand(Command): test_argv = test_argv0 + shlex.split(self.args) unittest.main(None, defaultTest='test.test_suite', argv=test_argv) +class CFFIBuild(build): + """Hack to combat the chicken and egg problem that we need cffi + to add cffi as an extension. + """ + def finalize_options(self): + # This ffi is pygit2.ffi due to the path trick used in the beginning + # of the file + from ffi import ffi -class BuildWithDLLs(build): + self.distribution.ext_modules.append(ffi.verifier.get_extension()) + build.finalize_options(self) + + +class BuildWithDLLs(CFFIBuild): # On Windows, we install the git2.dll too. def _get_dlls(self): @@ -166,19 +178,6 @@ with codecs.open('README.rst', 'r', 'utf-8') as readme: long_description = readme.read() -class CFFIBuild(build): - """Hack to combat the chicken and egg problem that we need cffi - to add cffi as an extension. - """ - def finalize_options(self): - # This ffi is pygit2.ffi due to the path trick used in the beginning - # of the file - from ffi import ffi - - self.distribution.ext_modules.append(ffi.verifier.get_extension()) - build.finalize_options(self) - - cmdclass = { 'test': TestCommand, 'sdist': sdist_files_from_git}