Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Synss committed Jan 19, 2016
2 parents 341ef56 + 0c1ec05 commit 22873cf
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
plugins = Cython.Coverage
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ __pycache__/
# C source file generated by Cython
# *.c

# HTML files
*.html

# Distribution / packaging
.Python
env/
Expand Down Expand Up @@ -45,6 +48,7 @@ htmlcov/
nosetests.xml
coverage.xml
*,cover
./cover

# Translations
*.mo
Expand Down
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
.DEFAULT_GOAL := debug

PYX = $(wildcard mbedtls/*.pyx)
PYX += $(wildcard mbedtls/cipher/*.pyx)
PYX += $(wildcard mbedtls/pk/*.pyx)

release:
cython $(PYX)
python setup.py build_ext

debug:
python setup.py build_ext --inplace
cython -a -X linetrace=True $(PYX)
CFLAGS='-DCYTHON_TRACE=1' python setup.py build_ext --inplace

test:
nosetests -v tests
nosetests -v \
--with-coverage --cover-package=mbedtls \
tests

html:
cd docs && make html
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
# built documents.
#
# The short X.Y version.
version = '0.4'
version = '0.5'
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
37 changes: 13 additions & 24 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
import os
from setuptools import setup, Extension


version = "0.4"
version = "0.5"
download_url = "https://github.com/Synss/python-mbedtls/tarball/%s" % version


extensions = [
Extension("mbedtls.exceptions", ["mbedtls/exceptions.c"]),
] + [
Extension("mbedtls.random", ["mbedtls/random.c"],
libraries=["mbedtls"],
include_dirs=["."],)
] + [
Extension("mbedtls.cipher.%s" % name, ["mbedtls/cipher/%s.c" % name],
libraries=["mbedtls"],
include_dirs=["."],) for name in
"_cipher __init__".split() +
"AES ARC4 Blowfish Camellia DES DES3 DES3dbl".split()
] + [
Extension("mbedtls.pk.%s" % name, ["mbedtls/pk/%s.c" % name],
libraries=["mbedtls"],
include_dirs=["."],) for name in
"_pk __init__ RSA".split()
] + [
Extension("mbedtls.%s" % name, ["mbedtls/%s.c" % name],
libraries=["mbedtls"],
include_dirs=["."],)
for name in "_md __init__ hash hmac".split()
]
extensions = []
for dirpath, dirnames, filenames in os.walk("mbedtls"):
for fn in filenames:
root, ext = os.path.splitext(fn)
if ext != ".c":
continue
mod = ".".join(dirpath.split(os.sep) + [root])
extensions.append(Extension(
mod, [os.path.join(dirpath, fn)],
libraries=["mbedtls"], include_dirs=["."]))


setup(
name="python-mbedtls",
Expand Down

0 comments on commit 22873cf

Please sign in to comment.