Hacking Python SDK » History » Version 4
Tom Clegg, 07/03/2014 11:40 AM
1 | 1 | Tom Clegg | h1. Hacking Python SDK |
---|---|---|---|
2 | |||
3 | {{toc}} |
||
4 | |||
5 | h2. Prerequisites |
||
6 | |||
7 | <pre> |
||
8 | sudo apt-get install python python-pip python-dev python-virtualenv libyaml-dev |
||
9 | </pre> |
||
10 | |||
11 | 4 | Tom Clegg | Additional prerequisites for FUSE driver: |
12 | |||
13 | <pre> |
||
14 | sudo apt-get install libattr1-dev libfuse-dev pkg-config |
||
15 | </pre> |
||
16 | |||
17 | 1 | Tom Clegg | h2. Get the source code |
18 | |||
19 | <pre> |
||
20 | cd |
||
21 | git clone https://github.com/curoverse/arvados.git |
||
22 | </pre> |
||
23 | |||
24 | h2. Run tests |
||
25 | |||
26 | Strategy: |
||
27 | # Install your local (possibly modified) client library to a virtualenv |
||
28 | # Run the client library test suite |
||
29 | 3 | Tom Clegg | # Build a client library package and install it to the virtualenv |
30 | 1 | Tom Clegg | # Install your local (possibly modified) FUSE driver to the same virtualenv |
31 | # Run the FUSE driver test suite |
||
32 | 3 | Tom Clegg | # Build a FUSE driver package and install it to the virtualenv |
33 | 1 | Tom Clegg | |
34 | 2 | Tom Clegg | Note: The test suite brings up a Keep server and an API server to run tests against. For best results: |
35 | * Try [[Hacking Keep]] and [[Hacking API Server]] to make sure you have all the right dependencies for running the Keep and API servers. |
||
36 | * Make sure you have a blob_signing_key in services/api/config/application.yml |
||
37 | 1 | Tom Clegg | |
38 | Script: |
||
39 | |||
40 | <pre> |
||
41 | VENVDIR=$(mktemp -d) |
||
42 | virtualenv --setuptools --system-site-packages "$VENVDIR" |
||
43 | |||
44 | cd ~/arvados/sdk/python |
||
45 | 4 | Tom Clegg | "$VENVDIR/bin/pip" install -r requirements.txt |
46 | 1 | Tom Clegg | "$VENVDIR/bin/pip" install -e . |
47 | GOPATH="$HOME/gocode" "$VENVDIR/bin/python" -m unittest discover tests |
||
48 | |||
49 | "$VENVDIR/bin/python" setup.py egg_info -b ".$(git log --format=format:%ct.%h -n1 .)" sdist rotate --keep=1 |
||
50 | "$VENVDIR/bin/pip" install dist/arvados-python-client-0.1.*.tar.gz |
||
51 | |||
52 | cd ~/arvados/services/fuse |
||
53 | 4 | Tom Clegg | "$VENVDIR/bin/pip" install -r requirements.txt |
54 | 1 | Tom Clegg | "$VENVDIR/bin/pip" install -e . |
55 | GOPATH="$HOME/gocode" "$VENVDIR/bin/python" -m unittest discover tests |
||
56 | |||
57 | "$VENVDIR/bin/python" setup.py egg_info -b ".$(git log --format=format:%ct.%h -n1 .)" sdist rotate --keep=1 |
||
58 | "$VENVDIR/bin/pip" install dist/arvados_fuse-0.1.*.tar.gz |
||
59 | </pre> |