summaryrefslogtreecommitdiff
path: root/README.rst
blob: 2172c469610a0a1ae8c8da2c41377be3d123abde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
LEAP                   
The LEAP Encryption Access Project
your internet encryption toolkit

Installation
=============

Dependencies
--------------
Listed in pkg/requirements.pip and pkg/test-requirements.pip

* python 2.6 or 2.7
* python setuptools
* qt4 libraries
* python-qt4
* python-gnutls == 1.1.9
* python-nose, python-mock, python-coverage (if you want to run tests)

If you are on a debian-based system, you can run:

apt-get install python-qt4 python-qt4-doc pyqt4-dev-tools python-gnutls libgnutls-dev python-setuptools python-nose


Install PyQt
------------
pip install PyQt will fail because PyQt4 does not use the standard setup.py mechanism.
Instead, they use configure.py which generates a Makefile.

python configure.py
make && make install

You can:

* (recommended) run pkg/postmkvenv.sh after creating your virtualenv. It will symlink to your global PyQt installation.
* install PyQt globally and make a virtualenv with --site-packages
* run pkg/install_pyqt.sh inside your virtualenv (with --no-site-packages)


Install
---------------

# need to run this if you are installing from the git source tree
# not needed if installing from a tarball.

python setup.py branding

# run this if you have installed previous versions before

python setup.py clean

python setup.py install # as root if installing globally.



Running the App
-----------------

If you're running a branded build, the script name will have a suffix that
depends on your build flavor. Look for it in /usr/local/bin

% leap-springbok-client

In order to run in debub mode:

% leap-springbok-client --debug --logfile /tmp/leap.log

To see all options:

% leap-springbok-client --help


Development
==============

Hack
--------------
Some steps to be run when setting a development environment for the first time.

# recommended: enable a virtualenv to isolate your libraries.

% virtualenv .  # ensure your .gitignore knows about it
% source bin/activate

# make sure you're in the development branch

(leap_client)% git checkout develop

(leap_client)% pkg/postmkvenv.sh

(leap_client)% python setup.py branding
(leap_client)% python setup.py develop  

to avoid messing with the entry point and global versions installed,
it's recommended to run the app like this during development cycle:

(leap_client)% cd src/leap 
(leap_client)% python app.py --debug

Install testing dependencies
----------------------------

have a look at setup/test-requires
The ./run_tests.sh command should install all of them in your virtualenv for you.

Running tests
-------------

./run_tests.sh

force no virtualenv and create coverage reports:
./run_tests.sh -N -c

if you want to run specific tests, pass the (sub)module to nose:

nosetests leap.util

or

nosetests leap.util.test_leap_argparse

Colorized output
----------------
Install rednose locally and activate it.

  (leap_client)% pip install rednose
  (leap_client)% export NOSE_REDNOSE=1

enjoy :)

Tox
---
For running testsuite against all the supported python versions (currently 2.6 and 2.7), run:

  tox -v


Compiling resource/ui files
-----------------------------

You should refresh resource/ui files every time you
change an image or a resource/ui (.ui / .qc). From
the root folder:

make ui
make resources

As there are some tests to guard against unwanted resource updates,
you will have to update the resource hash in those failing tests.