Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tinydtls-cython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jannis Konrad
tinydtls-cython
Commits
ff2f5870
Commit
ff2f5870
authored
7 years ago
by
Florian Klien
Browse files
Options
Downloads
Patches
Plain Diff
fixing Cypthon dependency
force setuptools to install Cython if it's not installed
parent
ff2aa5fc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+43
-24
43 additions, 24 deletions
setup.py
with
43 additions
and
24 deletions
setup.py
+
43
−
24
View file @
ff2f5870
...
...
@@ -4,39 +4,59 @@ import subprocess
from
distutils.core
import
setup
from
distutils.extension
import
Extension
from
distutils.command.build_ext
import
build_ext
from
Cython.Build
import
cythonize
CYTHON_VERSION
=
'
Cython==0.27.2
'
class
prepare_tinydtls
(
build_ext
):
def
run
(
self
):
def
run_command
(
args
):
print
(
"
Running:
"
,
"
"
.
join
(
args
))
subprocess
.
check_call
(
args
,
cwd
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
DTLSSocket
"
,
"
tinydtls
"
))
commands
=
[
[
"
autoconf
"
],
[
"
autoheader
"
],
[
"
./configure
"
,
"
--without-ecc
"
],
]
commands
=
[
[
"
autoconf
"
],
[
"
autoheader
"
],
[
"
./configure
"
,
"
--without-ecc
"
],
]
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
DTLSSocket
'
,
'
tinydtls
'
,
'
dtls.c
'
)):
run_command
([
"
git
"
,
"
submodule
"
,
"
update
"
,
"
--init
"
])
for
command
in
commands
:
run_command
(
command
)
build_ext
.
run
(
self
)
cy_build
=
cythonize
([
Extension
(
"
DTLSSocket.dtls
"
,
[
"
DTLSSocket/dtls.pyx
"
,
"
DTLSSocket/tinydtls/dtls.c
"
,
"
DTLSSocket/tinydtls/crypto.c
"
,
"
DTLSSocket/tinydtls/ccm.c
"
,
"
DTLSSocket/tinydtls/hmac.c
"
,
"
DTLSSocket/tinydtls/netq.c
"
,
"
DTLSSocket/tinydtls/peer.c
"
,
"
DTLSSocket/tinydtls/dtls_time.c
"
,
"
DTLSSocket/tinydtls/session.c
"
,
"
DTLSSocket/tinydtls/dtls_debug.c
"
,
"
DTLSSocket/tinydtls/aes/rijndael.c
"
,
"
DTLSSocket/tinydtls/sha2/sha2.c
"
],
include_dirs
=
[
'
DTLSSocket/tinydtls
'
],
define_macros
=
[(
'
DTLSv12
'
,
'
1
'
),
(
'
WITH_SHA256
'
,
'
1
'
),
(
'
DTLS_CHECK_CONTENTTYPE
'
,
'
1
'
),
(
'
_GNU_SOURCE
'
,
'
1
'
)],
undef_macros
=
[
"
NDEBUG
"
],
)])
# force setuptools to install Cython before proceeding
try
:
from
Cython.Build
import
cythonize
except
:
from
setuptools.dist
import
Distribution
Distribution
(
dict
(
setup_requires
=
CYTHON_VERSION
))
def
get_ext_modules
():
from
Cython.Build
import
cythonize
return
cythonize
([
Extension
(
"
DTLSSocket.dtls
"
,
[
"
DTLSSocket/dtls.pyx
"
,
"
DTLSSocket/tinydtls/ccm.c
"
,
"
DTLSSocket/tinydtls/crypto.c
"
,
"
DTLSSocket/tinydtls/dtls.c
"
,
"
DTLSSocket/tinydtls/dtls_debug.c
"
,
"
DTLSSocket/tinydtls/dtls_time.c
"
,
"
DTLSSocket/tinydtls/hmac.c
"
,
"
DTLSSocket/tinydtls/netq.c
"
,
"
DTLSSocket/tinydtls/peer.c
"
,
"
DTLSSocket/tinydtls/session.c
"
,
"
DTLSSocket/tinydtls/aes/rijndael.c
"
,
"
DTLSSocket/tinydtls/sha2/sha2.c
"
],
include_dirs
=
[
'
DTLSSocket/tinydtls
'
],
define_macros
=
[(
'
DTLSv12
'
,
'
1
'
),
(
'
WITH_SHA256
'
,
'
1
'
),
(
'
DTLS_CHECK_CONTENTTYPE
'
,
'
1
'
),
(
'
_GNU_SOURCE
'
,
'
1
'
)],
undef_macros
=
[
"
NDEBUG
"
],
)])
ext_modules
=
get_ext_modules
()
setup
(
name
=
"
DTLSSocket
"
,
...
...
@@ -47,7 +67,6 @@ setup(
url
=
"
https://git.fslab.de/jkonra2m/tinydtls-cython
"
,
py_modules
=
[
"
DTLSSocket.DTLSSocket
"
],
cmdclass
=
{
"
build_ext
"
:
prepare_tinydtls
},
ext_modules
=
cy_build
,
setup_requires
=
[
"
Cython==0.27.2
"
],
install_requires
=
[
"
Cython==0.27.2
"
],
ext_modules
=
ext_modules
,
setup_requires
=
[
CYTHON_VERSION
],
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment