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
f86e77b3
Commit
f86e77b3
authored
12 years ago
by
Donald Stufft
Browse files
Options
Downloads
Patches
Plain Diff
Switch travis to using invoke tasks
parent
6dddee6a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.travis.yml
+6
-6
6 additions, 6 deletions
.travis.yml
tasks.py
+86
-0
86 additions, 0 deletions
tasks.py
with
92 additions
and
6 deletions
.travis.yml
+
6
−
6
View file @
f86e77b3
...
@@ -6,11 +6,11 @@ python:
...
@@ -6,11 +6,11 @@ python:
-
"
3.3"
-
"
3.3"
-
"
pypy"
-
"
pypy"
install
:
install
:
-
sudo tests/install_sodium.sh
-
/usr/bin/pip install git+git://github.com/pyinvoke/invoke.git
-
pip install -q "file://$PWD#egg=pynacl[tests]"
-
'
if
[
-n
"${VAR+x}"
];
then:
invoke
install-nacl
--library=$NACL;
fi'
-
'
if
[
-n
"${VAR+x}"
];
then:
invoke
install
--dev;
fi'
script
:
script
:
-
pep8 nacl
-
invoke tests --suite=$SUITE --libpath=/usr/local/lib
-
pylint --rcfile .pylintrc -r y nacl
-
py.test
env
:
env
:
-
LD_LIBRARY_PATH=/usr/local/lib LD_RUN_PATH=/usr/local/lib
-
NACL=libsodium SUITE=unit
-
"
SUITE=pep8,lint"
This diff is collapsed.
Click to expand it.
tasks.py
0 → 100644
+
86
−
0
View file @
f86e77b3
import
hashlib
import
os
import
urllib2
from
invoke
import
task
,
run
def
download
(
url
,
hash
,
path
):
resp
=
urllib2
.
urlopen
(
url
)
content
=
resp
.
read
()
content_hash
=
hashlib
.
sha256
(
content
).
hexdigest
()
assert
hash
==
content_hash
with
open
(
path
,
"
wb
"
)
as
fp
:
fp
.
write
(
content
)
@task
(
aliases
=
[
"
install-nacl
"
])
def
install_nacl
(
library
):
def
_install_libsodium
():
tarball_path
=
os
.
path
.
expanduser
(
"
~/libsodium-0.2.tar.gz
"
)
# Download libsodium and verify it's hash
download
(
"
http://download.dnscrypt.org/libsodium/releases/libsodium-0.2.tar.gz
"
,
"
e99a6b69adc080a5acf6b8a49fdc74b61d6f3579b590e85c93446a8325dde100
"
,
tarball_path
,
)
curdir
=
os
.
getcwd
()
try
:
os
.
chdir
(
os
.
path
.
expanduser
(
"
~/
"
))
# Unpack the tarball
run
(
"
tar xf libsodium-0.2.tar.gz
"
)
# Configure and install the library
os
.
chdir
(
os
.
path
.
expanduser
(
"
~/libsodium-0.2/
"
))
run
(
"
./configure --disable-debug --disable-dependency-tracking
"
)
run
(
"
make
"
)
run
(
"
make check
"
)
run
(
"
make install
"
)
finally
:
os
.
chdir
(
curdir
)
def
_install_nacl
():
raise
NotImplementedError
libraries
=
{
"
libsodium
"
:
_install_libsodium
,
"
nacl
"
:
_install_nacl
,
}
# Install the library
libraries
[
library
]()
@task
def
install
(
dev
=
False
):
cmd
=
"
pip install -e file://$PWD#egg=pynacl
"
if
dev
:
cmd
+=
"
[tests]
"
run
(
cmd
)
@task
def
tests
(
libpath
=
None
,
suite
=
None
):
if
libpath
is
not
None
:
os
.
environ
[
"
LD_LIBRARY_PATH
"
]
=
libpath
os
.
environ
[
"
LD_RUN_PATH
"
]
=
libpath
if
suite
is
None
:
suite
=
set
([
"
pep8
"
,
"
lint
"
,
"
unit
"
])
else
:
suite
=
set
(
suite
.
split
(
"
,
"
))
if
"
pep8
"
in
suite
:
run
(
"
pep8 nacl
"
)
if
"
lint
"
in
suite
:
run
(
"
pylint --rcfile .pylintrc -r y nacl
"
)
if
"
unit
"
in
suite
:
run
(
"
py.test
"
)
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