File: run.sh

package info (click to toggle)
python-django-adminplus 0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 164 kB
  • sloc: python: 209; sh: 43; makefile: 4
file content (42 lines) | stat: -rwxr-xr-x 887 bytes parent folder | download
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
#!/bin/sh

export PYTHONPATH=".:$PYTHONPATH"
export DJANGO_SETTINGS_MODULE="test_settings"

PROG="$0"
CMD="$1"
shift

usage() {
    echo "USAGE: $PROG [command]"
    echo "  test - run the adminplus tests"
    echo "  lint - run flake8 (alias: flake8)"
    echo "  shell - open the Django shell"
    echo "  build - build a package for release"
    echo "  check - run twine check on build artifacts"
    exit 1
}

case "$CMD" in
    "test" )
        echo "Django version: $(python -m django --version)"
        python -m django test adminplus
        ;;
    "lint"|"flake8" )
        echo "Flake8 version: $(flake8 --version)"
        flake8 "$@" adminplus/
        ;;
    "shell" )
        python -m django shell
        ;;
    "build" )
        rm -rf dist/*
        python -m build
        ;;
    "check" )
        twine check dist/*
        ;;
    * )
        usage
        ;;
esac