-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
56 lines (47 loc) · 1.45 KB
/
Taskfile.yml
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
version: '3'
env:
PYTHONPATH: "{PWD}:${PYTHONPATH}"
tasks:
default:
desc: help
cmds:
- task --list
run:
desc: Run the simple routing daemon.
deps: [ install ]
interactive: true
cmds:
- sudo ./network-setup.sh --overwrite
- sudo ip netns exec basic {{.USER_WORKING_DIR}}/venv/bin/python3 pygmp simple --config ./tests/simple_confs/basic1.ini
install:
desc: Build the extension in-place and install. Adds metadata to venv lib linking source to pygmp directory.
deps: [ make-venv ]
cmds:
- ./venv/bin/pip3 install -e .[daemons]
status:
- '[ -n "$(find ./venv/lib/*/site-packages -type d -name "pygmp-*.dist-info" -print -quit)" ]'
test:
desc: Run pytests.
deps: [ install ]
cmds:
- sudo {{.USER_WORKING_DIR}}/venv/bin/python3 -m pytest -s {{.CLI_ARGS}}
setup-network:
desc: Setup the network namespaces for testing.
cmds:
- sudo ./network-setup.sh --overwrite
build-docs:
# FIXME: requires you activate the venv first
desc: Build the documentation.
cmds:
- sphinx-build -E -b html docs/ docs/_build/html
make-venv:
cmds:
- python3 -m pip install virtualenv
- python3 -m venv venv --upgrade-deps --copies
# - sudo setcap cap_net_admin+ep ./python3
- ./venv/bin/pip3 install -r dev-requirements.txt
status:
- '[ -d ./venv ]'
preconditions:
- sh: "which python3"
msg: "You must have python3"