Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
clients
python
sakia
Commits
5a586861
Commit
5a586861
authored
11 years ago
by
Donald Stufft
Browse files
Options
Downloads
Patches
Plain Diff
Updates to properly handle CFFI
parent
449a6e27
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
MANIFEST.in
+1
-1
1 addition, 1 deletion
MANIFEST.in
nacl/nacl.py
+6
-5
6 additions, 5 deletions
nacl/nacl.py
setup.py
+2
-2
2 additions, 2 deletions
setup.py
tox.ini
+1
-2
1 addition, 2 deletions
tox.ini
with
10 additions
and
10 deletions
MANIFEST.in
+
1
−
1
View file @
5a586861
...
@@ -35,4 +35,4 @@ recursive-include tests *.py
...
@@ -35,4 +35,4 @@ recursive-include tests *.py
recursive-include tests/data *
recursive-include tests/data *
# Remove CFFI files
# Remove CFFI files
recursive-exclude nacl
_cffi_
*.c
recursive-exclude nacl *.c
This diff is collapsed.
Click to expand it.
nacl/nacl.py
+
6
−
5
View file @
5a586861
...
@@ -79,11 +79,6 @@ ffi.cdef(
...
@@ -79,11 +79,6 @@ ffi.cdef(
ffi
.
verifier
=
Verifier
(
ffi
,
ffi
.
verifier
=
Verifier
(
ffi
,
"
#include <sodium.h>
"
,
"
#include <sodium.h>
"
,
# We need to set a tmp directory otherwise when build_ext is run it'll get
# built in nacl/*.so but when ffi.verifier.load_library() is run it'll
# look (and ultimately build again) in nacl/__pycache__/*.so
tmpdir
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)),
# We need to link to the sodium library
# We need to link to the sodium library
libraries
=
[
"
sodium
"
],
libraries
=
[
"
sodium
"
],
...
@@ -141,6 +136,12 @@ class Library(object):
...
@@ -141,6 +136,12 @@ class Library(object):
self
.
_ffi
=
ffi
self
.
_ffi
=
ffi
self
.
_initalized
=
False
self
.
_initalized
=
False
# This prevents the compile_module() from being called, the module
# should have been compiled by setup.py
def
_compile_module
(
*
args
,
**
kwargs
):
raise
RuntimeError
(
"
Cannot compile module during runtime
"
)
self
.
_ffi
.
verifier
.
compile_module
=
_compile_module
def
__getattr__
(
self
,
name
):
def
__getattr__
(
self
,
name
):
if
not
self
.
_initalized
:
if
not
self
.
_initalized
:
self
.
_lib
=
self
.
_ffi
.
verifier
.
load_library
()
self
.
_lib
=
self
.
_ffi
.
verifier
.
load_library
()
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
2
−
2
View file @
5a586861
...
@@ -185,7 +185,7 @@ setup(
...
@@ -185,7 +185,7 @@ setup(
"
include_dirs
"
:
[
"
include_dirs
"
:
[
sodium
(
"
include/sodium
"
),
sodium
(
"
include/sodium
"
),
],
],
"
sources
"
:
map
(
sodium
,
[
"
sources
"
:
[
sodium
(
s
)
for
s
in
[
"
crypto_auth/crypto_auth.c
"
,
"
crypto_auth/crypto_auth.c
"
,
"
crypto_auth/hmacsha256/auth_hmacsha256_api.c
"
,
"
crypto_auth/hmacsha256/auth_hmacsha256_api.c
"
,
"
crypto_auth/hmacsha256/ref/hmac_hmacsha256.c
"
,
"
crypto_auth/hmacsha256/ref/hmac_hmacsha256.c
"
,
...
@@ -312,7 +312,7 @@ setup(
...
@@ -312,7 +312,7 @@ setup(
"
sodium/core.c
"
,
"
sodium/core.c
"
,
"
sodium/utils.c
"
,
"
sodium/utils.c
"
,
"
sodium/version.c
"
,
"
sodium/version.c
"
,
]
)
,
]
]
,
}),
}),
],
],
...
...
This diff is collapsed.
Click to expand it.
tox.ini
+
1
−
2
View file @
5a586861
...
@@ -4,5 +4,4 @@ envlist = py26,py27,pypy,py32,py33
...
@@ -4,5 +4,4 @@ envlist = py26,py27,pypy,py32,py33
[testenv]
[testenv]
deps
=
deps
=
pytest
pytest
pytest-cov
commands
=
py.test
commands
=
py.test --cov=nacl/
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