Hacking Python SDK » History » Version 1

Tom Clegg, 07/03/2014 10:52 AM

1 1 Tom Clegg
h1. Hacking Python SDK
2 1 Tom Clegg
3 1 Tom Clegg
{{toc}}
4 1 Tom Clegg
5 1 Tom Clegg
h2. Prerequisites
6 1 Tom Clegg
7 1 Tom Clegg
<pre>
8 1 Tom Clegg
sudo apt-get remove python-yaml
9 1 Tom Clegg
sudo apt-get install python python-pip python-dev python-virtualenv libyaml-dev
10 1 Tom Clegg
</pre>
11 1 Tom Clegg
12 1 Tom Clegg
h2. Get the source code
13 1 Tom Clegg
14 1 Tom Clegg
<pre>
15 1 Tom Clegg
cd
16 1 Tom Clegg
git clone https://github.com/curoverse/arvados.git
17 1 Tom Clegg
</pre>
18 1 Tom Clegg
19 1 Tom Clegg
h2. Run tests
20 1 Tom Clegg
21 1 Tom Clegg
Strategy:
22 1 Tom Clegg
# Install your local (possibly modified) client library to a virtualenv
23 1 Tom Clegg
# Run the client library test suite
24 1 Tom Clegg
# Install your local (possibly modified) FUSE driver to the same virtualenv
25 1 Tom Clegg
# Run the FUSE driver test suite
26 1 Tom Clegg
27 1 Tom Clegg
Note: The test suite brings up a Keep server and an API server to run tests against. If this doesn't work, try [[Hacking Keep]] and [[Hacking API Server]] to make sure you have all the right dependencies for running the Keep and API servers.
28 1 Tom Clegg
29 1 Tom Clegg
Script:
30 1 Tom Clegg
31 1 Tom Clegg
<pre>
32 1 Tom Clegg
VENVDIR=$(mktemp -d)
33 1 Tom Clegg
virtualenv --setuptools --system-site-packages "$VENVDIR"
34 1 Tom Clegg
35 1 Tom Clegg
cd ~/arvados/sdk/python
36 1 Tom Clegg
"$VENVDIR/bin/pip" install -e .
37 1 Tom Clegg
GOPATH="$HOME/gocode" "$VENVDIR/bin/python" -m unittest discover tests
38 1 Tom Clegg
39 1 Tom Clegg
"$VENVDIR/bin/python" setup.py egg_info -b ".$(git log --format=format:%ct.%h -n1 .)" sdist rotate --keep=1
40 1 Tom Clegg
"$VENVDIR/bin/pip" install dist/arvados-python-client-0.1.*.tar.gz
41 1 Tom Clegg
42 1 Tom Clegg
cd ~/arvados/services/fuse
43 1 Tom Clegg
"$VENVDIR/bin/pip" install -e .
44 1 Tom Clegg
GOPATH="$HOME/gocode" "$VENVDIR/bin/python" -m unittest discover tests
45 1 Tom Clegg
46 1 Tom Clegg
"$VENVDIR/bin/python" setup.py egg_info -b ".$(git log --format=format:%ct.%h -n1 .)" sdist rotate --keep=1
47 1 Tom Clegg
"$VENVDIR/bin/pip" install dist/arvados_fuse-0.1.*.tar.gz
48 1 Tom Clegg
</pre>