README.md 2.02 KB
Newer Older
CHARLES's avatar
CHARLES committed
1
2
3
4
5


# Downloader daemon

Checks online services for changed in data files, and downloads them when needed.
CHARLES's avatar
CHARLES committed
6
7
8

# Installation

CHARLES's avatar
CHARLES committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## PIP configuration

This projects use dependencies that are not publicly available on pypi.org. Create / modify the following file to configure pip to fetch packages on `nexus-test.ifremer.fr`.

- Linux: `~/.config/pip/pip.conf`
- Windows: `%APPDATA%\pip\pip.ini`

```ini
[global]
index = https://nexus-test.ifremer.fr/repository/pypi-public-release/pypi
index-url = https://nexus-test.ifremer.fr/repository/pypi-public-release/simple

extra-index-url=
    https://nexus-test.ifremer.fr/repository/pypi-public-snapshot/simple
    https://nexus-test.ifremer.fr/repository/pypi-private-release/simple
    https://nexus-test.ifremer.fr/repository/pypi-private-snapshot/simple
```

CHARLES's avatar
CHARLES committed
27
28
29
30
31
32
33
34
35
36
37
38
## Conda

```
# Create conda env
conda env create -f environment.yaml

# Activate created env
conda activate downloader

# Install the downloader
./setup.py install
```
CHARLES's avatar
CHARLES committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56


# Development

## Tooling

```
# Install developer tools
pip install -r requirements-dev.txt
```

### Linter

Using command-line:
```bash
# Run linter against current codebase
pylint --errors-only --output-format=colorized lib/
# The --errors-only flag only shows the errors
CHARLES's avatar
CHARLES committed
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

# Detect more issues:
pylint --disable=C0103,C0111,C0301,C0302,C0411,C1801,R0205,R0902,R0904,R0912,R0913,R0914,R0915 lib/
# C0103: snake_case convention
# C0111: missing doc
# C0301: line too long
# C0302: too many lines
# C0411: import order
# C1801: length != 0 as condition
# R0205: explicit object inheritance
# R0902: too many attributes
# R0904: too many methods
# R0912: too many branches
# R0913: too many arguments
# R0914: too many local variables
# R0915: too many instructions
CHARLES's avatar
CHARLES committed
73
74
75
76
77
78
79
80
81
82
83
84
```

There are also plugins for many editors and IDEs.

### Code formatting

The code has been automatically formatted to follow PEP8 standard.
```bash
# Format every python source file in lib/ folder
autopep8 --in-place --recursive -j8 lib/
```

CHARLES's avatar
CHARLES committed
85
86
87
88
89
90
91
There are also plugins for many editors and IDEs.

### Unit testing

```
pytest lib/
```