README.md 4.97 KB
Newer Older
inso's avatar
inso committed
1
<!-- Landscape | [![Code Health](https://landscape.io/github/duniter/sakia/dev/landscape.svg?style=flat)](https://landscape.io/github/duniter/sakia/dev) -->
inso's avatar
inso committed
2

inso's avatar
inso committed
3
![sakia logo](https://raw.github.com/duniter/sakia/master/sakia.png)
inso's avatar
inso committed
4

inso's avatar
Layout    
inso committed
5
# Sakia
inso's avatar
inso committed
6
7
 [![coverage report](https://git.duniter.org/clients/python/sakia/badges/gitlab/coverage.svg)](https://git.duniter.org/clients/python/sakia/commits/gitlab)
 [![pipeline status](https://git.duniter.org/clients/python/sakia/badges/gitlab/pipeline.svg)](https://git.duniter.org/clients/python/sakia/commits/gitlab)
inso's avatar
inso committed
8
9
10
 [![Build Status](https://travis-ci.org/duniter/sakia.svg?branch=travis)](https://travis-ci.org/duniter/sakia)
 [![Build status](https://ci.appveyor.com/api/projects/status/pvl18xon8pvu2c8w/branch/dev?svg=true)](https://ci.appveyor.com/project/Insoleet/sakia-bee4m/branch/dev)

inso's avatar
inso committed
11
12
========

inso's avatar
inso committed
13
Python3 and PyQt5 Client for [duniter](http://www.duniter.org) project.
14
15


inso's avatar
inso committed
16
### Features
17
18
  * Accounts management
  * Communities viewing
inso's avatar
inso committed
19
  * Money Transfer
inso's avatar
inso committed
20
  * Wallets management
inso's avatar
inso committed
21
  * Contacts management
inso's avatar
inso committed
22
23
  * Joining a community, publishing keys
  * Multiple wallets management
inso's avatar
inso committed
24

inso's avatar
inso committed
25
### Dependencies
inso's avatar
inso committed
26
  * Dependencies :
inso's avatar
inso committed
27
   * Qt5
inso's avatar
inso committed
28
29
   * [python3](https://www.python.org/downloads/)
   * [libsodium](http://doc.libsodium.org/installation/README.html)
inso's avatar
inso committed
30

inso's avatar
inso committed
31
  * General tips : use pyenv to build sakia, as described in the [wiki](https://github.com/duniter/sakia/wiki/Cutecoin-install-for-developpers)
inso's avatar
inso committed
32

33
34
35
36
37
38
39
40
  Building python 3 with pyenv requires libraries of `openssl` and `sqlite3`. On Ubuntu, install it using the following commands : 

```
apt-get update
apt-get install libssl-dev
apt-get install libsqlite3-dev
```

inso's avatar
inso committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
### Wheel Build scripts
  * Install __wheel__ with `pip install wheel`
  * Run `python3 gen_resources.py` in sakia folder
  * Run `python3 gen_translations.py` in sakia folder
  * To build the wheel : Run `python3 setup.py bdist_wheel` in sakia folder
  
### Pyinstaller Build scripts
  * Install __pyinstaller__ with `pip install pyinstaller`
  * Run `python3 gen_resources.py` in sakia folder
  * Run `python3 gen_translations.py` in sakia folder
  * To build the binaries : Run `pyinstall sakia.spec`

### Install with pip
  * Run `pip install sakia`
  * start "sakia" :)
 
Moul's avatar
Moul committed
57
### Download latest release
inso's avatar
inso committed
58
  * Go to [current release](https://github.com/duniter/sakia/releases)
Moul's avatar
Moul committed
59
  * Download corresponding package to your operating system
inso's avatar
inso committed
60
  * Unzip and start "sakia" :)
inso's avatar
inso committed
61
  * Join our beta community by contacting us on [duniter forum](http://forum.duniter.org/)
Moul's avatar
Moul committed
62

63
64
65
66
67
68
## Command line options

`-d` to display log to debug

`--currency g1-test` to connect to the g1-test currency network.

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
## Development
* When writing docstrings, use the reStructuredText format recommended by https://www.python.org/dev/peps/pep-0287/#docstring-significant-features
* Use make commands to check the code and the format it correct.

The development tools require Python 3.6.x or higher.

* Create a python virtual environment with [pyenv](https://github.com/pyenv/pyenv)
```bash
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
```

* Install dependencies
```bash
pip install -r requirements.txt
```

* Run Sakia from the source code
```bash
PYTHONPATH="`pwd`/src/." python src/sakia/main.py
```

* Before submiting a merge requests, please check the static typing and tests.

* Install dev dependencies
```bash
pip install -r requirements_dev.txt
```

* Check static typing with [mypy](http://mypy-lang.org/)
```bash
make check
```

* Run all unit tests (pytest module) with:
```bash
make tests
```
106
> **Warning:** *do not run tests with sakia installed in your dev environment, because pytest will use the installed Sakia.*
107
108
109

* Run only some unit tests by passing a special ENV variable:
```bash
110
make tests TESTS_FILTER=tests/functional/test_transfer_dialog.py::test_transfer
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
```

## Packaging and deploy
### PyPi
In the development pyenv environment, install the tools to build and deploy
```bash
pip install --upgrade -r requirements_deploy.txt
```

Change and commit and tag the new version number (semantic version number)
```bash
./release.sh 0.x.y
```

Build the PyPi package in the `dist` folder
```bash
make build
```

Deploy the package to PyPi test repository (prefix the command with a space in order for the shell not to save in its history system the command containing the password)
```bash
[SPACE]make deploy_test PYPI_TEST_LOGIN=xxxx PYPI_TEST_PASSWORD=xxxx
```

Install the package from PyPi test repository
```bash
137
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.python.org/simple/ sakia
138
139
140
141
142
143
144
```

Deploy the package on the PyPi repository (prefix the command with a space in order for the shell not to save in its history system the command containing the password)
```bash
[SPACE]make deploy PYPI_LOGIN=xxxx PYPI_PASSWORD=xxxx
```

145
146
147
148
149
150
151
152
### AppImage

```bash
make appimage
```
The make command will do a wheel build, then create the AppImage file `ci/appimage/Sakia_x86_64.AppImage`


Moul's avatar
Moul committed
153
## License
inso's avatar
inso committed
154
This software is distributed under [GNU GPLv3](https://raw.github.com/duniter/sakia/dev/LICENSE).