mirror of
https://github.com/borgbackup/borg.git
synced 2024-09-19 08:18:10 +03:00
Fix setuptools Cython issue
This commit is contained in:
parent
be8a14bd7e
commit
6ffa7e851c
1
fake_pyrex/Pyrex/Distutils/__init__.py
Normal file
1
fake_pyrex/Pyrex/Distutils/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
# This is a python package
|
6
fake_pyrex/Pyrex/Distutils/build_ext.py
Normal file
6
fake_pyrex/Pyrex/Distutils/build_ext.py
Normal file
@ -0,0 +1,6 @@
|
||||
from distutils.command.build_ext import build_ext
|
||||
#
|
||||
#def build_ext(*args, **kw):
|
||||
# from distutils import build_ext as build_ext_orig
|
||||
# return build_ext_orig(*args, **kw)
|
||||
|
1
fake_pyrex/Pyrex/__init__.py
Normal file
1
fake_pyrex/Pyrex/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
# This is a python package
|
14
setup.py
14
setup.py
@ -3,6 +3,13 @@
|
||||
import os
|
||||
import sys
|
||||
from glob import glob
|
||||
|
||||
try:
|
||||
import Cython
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "fake_pyrex"))
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from setuptools import setup, Extension
|
||||
from setuptools.command.sdist import sdist
|
||||
hashindex_sources = ['darc/hashindex.pyx', 'darc/_hashindex.c']
|
||||
@ -18,9 +25,10 @@ def __init__(self, *args, **kwargs):
|
||||
cython_compiler.default_options)
|
||||
sdist.__init__(self, *args, **kwargs)
|
||||
|
||||
def run(self):
|
||||
sdist.run(self)
|
||||
self.filelist.append('darc/hashindex.c', 'darc/hashindex.h')
|
||||
def make_distribution(self):
|
||||
self.filelist.append('darc/hashindex.c')
|
||||
self.filelist.append('darc/hashindex.h')
|
||||
sdist.make_distribution(self)
|
||||
|
||||
except ImportError:
|
||||
hashindex_sources[0] = hashindex_sources[0].replace('.pyx', '.c')
|
||||
|
Loading…
Reference in New Issue
Block a user