-
Notifications
You must be signed in to change notification settings - Fork 13
/
run
executable file
·53 lines (39 loc) · 1.38 KB
/
run
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
#!/usr/bin/env sh
set -e
url="https://raw.githubusercontent.com/webuni/shell-task-runner/master/runner"
[ -f ./.runner ] && [ .runner -nt "$0" ] || wget -q "$url" -O- > .runner || curl -fso .runner "$url"
. ./.runner
_decorator()( _decorator_docker_compose_run "$@" )
# Install dependencies
task_deps()( _run pip install --ignore-installed --no-binary -e .[code,test,extra] "sphinx==${SPHINX_VERSION:-4.*}" 2>&1 )
# Update dependencies to the latest versions
task_deps__latest()( _run pip install --ignore-installed --upgrade -e .[code,test,extra] "sphinx==${SPHINX_VERSION:-4.*}" 2>&1 )
# Init virtual environment
# @service python
task_init()( python3 -m venv ./venv/ ) # --system-site-packages
# Run pip
# @service python
task_pip()( pip3 "$@" )
# Publish package
# @service python
task_publish()( python setup.py sdist && twine check dist/* && twine upload dist/* ) # flit publish
# Run flit
# @service python
task_flit()( flit "$@" )
# Run tests
# @service python
task_tests()( pytest "$@" )
# Fix code style
# @service python
task_cs()( black sphinxcontrib tests )
# Fix code style
# @service python
task_flake8()( flake8 sphinxcontrib tests )
# Analyse code
# @service python
task_analyse()( mypy sphinxcontrib )
# Remove all containers in project (use -v to remove volumes also)
task_clean()( _docker_compose down --remove-orphans "$@" )
# Run shell
# @service python
task_shell()( sh "$@" )