Skip to content
Snippets Groups Projects
Commit 5ef5ec29 authored by Jannis Konrad's avatar Jannis Konrad
Browse files

make pip install cython before we need it

parent 4ae195db
No related branches found
No related tags found
No related merge requests found
...@@ -5,8 +5,6 @@ from setuptools import setup ...@@ -5,8 +5,6 @@ from setuptools import setup
from setuptools.extension import Extension from setuptools.extension import Extension
from setuptools.command.build_ext import build_ext from setuptools.command.build_ext import build_ext
CYTHON_VERSION = 'Cython==0.27.2'
class prepare_tinydtls(build_ext): class prepare_tinydtls(build_ext):
def run(self): def run(self):
def run_command(args): def run_command(args):
...@@ -23,17 +21,17 @@ class prepare_tinydtls(build_ext): ...@@ -23,17 +21,17 @@ class prepare_tinydtls(build_ext):
run_command(command) run_command(command)
build_ext.run(self) build_ext.run(self)
# force setuptools to install Cython before proceeding setup(
try: name="DTLSSocket",
from Cython.Build import cythonize version='0.1.6',
except: description = "DTLSSocket is a cython wrapper for tinydtls with a Socket like interface",
from setuptools.dist import Distribution author = "Jannis Konrad",
Distribution(dict(setup_requires=CYTHON_VERSION)) author_email= "Jannis.Konrad@h-brs.de",
finally: url = "https://git.fslab.de/jkonra2m/tinydtls-cython",
from Cython.Build import cythonize py_modules = [ "DTLSSocket.DTLSSocket"],
cmdclass = {"build_ext": prepare_tinydtls},
ext_modules = cythonize([ setup_requires = [ "cython", ],
Extension("DTLSSocket.dtls", ext_modules = [Extension("DTLSSocket.dtls",
[ [
"DTLSSocket/dtls.pyx", "DTLSSocket/dtls.pyx",
"DTLSSocket/tinydtls/ccm.c", "DTLSSocket/tinydtls/ccm.c",
...@@ -54,19 +52,5 @@ ext_modules = cythonize([ ...@@ -54,19 +52,5 @@ ext_modules = cythonize([
('DTLS_CHECK_CONTENTTYPE', '1'), ('DTLS_CHECK_CONTENTTYPE', '1'),
('_GNU_SOURCE', '1')], ('_GNU_SOURCE', '1')],
undef_macros = [ "NDEBUG" ], undef_macros = [ "NDEBUG" ],
)]) ),]
setup(
name="DTLSSocket",
version='0.1.5',
description = "DTLSSocket is a cython wrapper for tinydtls with a Socket like interface",
author = "Jannis Konrad",
author_email= "Jannis.Konrad@h-brs.de",
url = "https://git.fslab.de/jkonra2m/tinydtls-cython",
py_modules = [ "DTLSSocket.DTLSSocket"],
cmdclass = {"build_ext": prepare_tinydtls},
ext_modules = ext_modules,
setup_requires = [ CYTHON_VERSION ],
install_requires = [ CYTHON_VERSION ],
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment