Skip to content

Commit 22873cf

Browse files
committed
Merge branch 'develop'
2 parents 341ef56 + 0c1ec05 commit 22873cf

File tree

5 files changed

+30
-27
lines changed

5 files changed

+30
-27
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
plugins = Cython.Coverage

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ __pycache__/
88
# C source file generated by Cython
99
# *.c
1010

11+
# HTML files
12+
*.html
13+
1114
# Distribution / packaging
1215
.Python
1316
env/
@@ -45,6 +48,7 @@ htmlcov/
4548
nosetests.xml
4649
coverage.xml
4750
*,cover
51+
./cover
4852

4953
# Translations
5054
*.mo

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
.DEFAULT_GOAL := debug
22

3+
PYX = $(wildcard mbedtls/*.pyx)
4+
PYX += $(wildcard mbedtls/cipher/*.pyx)
5+
PYX += $(wildcard mbedtls/pk/*.pyx)
6+
37
release:
8+
cython $(PYX)
49
python setup.py build_ext
510

611
debug:
7-
python setup.py build_ext --inplace
12+
cython -a -X linetrace=True $(PYX)
13+
CFLAGS='-DCYTHON_TRACE=1' python setup.py build_ext --inplace
814

915
test:
10-
nosetests -v tests
16+
nosetests -v \
17+
--with-coverage --cover-package=mbedtls \
18+
tests
1119

1220
html:
1321
cd docs && make html

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
# built documents.
6868
#
6969
# The short X.Y version.
70-
version = '0.4'
70+
version = '0.5'
7171
# The full version, including alpha/beta/rc tags.
7272
release = version
7373

setup.py

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
1+
import os
12
from setuptools import setup, Extension
23

34

4-
version = "0.4"
5+
version = "0.5"
56
download_url = "https://github.com/Synss/python-mbedtls/tarball/%s" % version
67

78

8-
extensions = [
9-
Extension("mbedtls.exceptions", ["mbedtls/exceptions.c"]),
10-
] + [
11-
Extension("mbedtls.random", ["mbedtls/random.c"],
12-
libraries=["mbedtls"],
13-
include_dirs=["."],)
14-
] + [
15-
Extension("mbedtls.cipher.%s" % name, ["mbedtls/cipher/%s.c" % name],
16-
libraries=["mbedtls"],
17-
include_dirs=["."],) for name in
18-
"_cipher __init__".split() +
19-
"AES ARC4 Blowfish Camellia DES DES3 DES3dbl".split()
20-
] + [
21-
Extension("mbedtls.pk.%s" % name, ["mbedtls/pk/%s.c" % name],
22-
libraries=["mbedtls"],
23-
include_dirs=["."],) for name in
24-
"_pk __init__ RSA".split()
25-
] + [
26-
Extension("mbedtls.%s" % name, ["mbedtls/%s.c" % name],
27-
libraries=["mbedtls"],
28-
include_dirs=["."],)
29-
for name in "_md __init__ hash hmac".split()
30-
]
9+
extensions = []
10+
for dirpath, dirnames, filenames in os.walk("mbedtls"):
11+
for fn in filenames:
12+
root, ext = os.path.splitext(fn)
13+
if ext != ".c":
14+
continue
15+
mod = ".".join(dirpath.split(os.sep) + [root])
16+
extensions.append(Extension(
17+
mod, [os.path.join(dirpath, fn)],
18+
libraries=["mbedtls"], include_dirs=["."]))
19+
3120

3221
setup(
3322
name="python-mbedtls",

0 commit comments

Comments
 (0)