-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmake.bat
More file actions
90 lines (75 loc) · 1.99 KB
/
make.bat
File metadata and controls
90 lines (75 loc) · 1.99 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@echo off
setlocal
if "%1"=="" goto help
if "%1"=="help" goto help
if "%1"=="clean" goto clean
if "%1"=="install" goto install
if "%1"=="test" goto test
if "%1"=="lint" goto lint
if "%1"=="lint-netgsm" goto lint-netgsm
if "%1"=="lint-tests" goto lint-tests
if "%1"=="lint-examples" goto lint-examples
if "%1"=="format" goto format
if "%1"=="format-netgsm" goto format-netgsm
if "%1"=="format-tests" goto format-tests
if "%1"=="format-examples" goto format-examples
if "%1"=="build" goto build
if "%1"=="publish" goto publish
:help
echo clean - remove all build, test, coverage and Python artifacts
echo install - install the package to the active Python's site-packages
echo test - run tests with pytest
echo lint - check style with flake8 and black (all)
echo format - format code with black (all)
echo build - package
echo publish - package and upload a release
goto :eof
:clean
py -c "import shutil; import glob; import os; [shutil.rmtree(p, ignore_errors=True) for p in ['build', 'dist', '*.egg-info', '.coverage', 'htmlcov', '.pytest_cache', '.tox'] + glob.glob('**/__pycache__', recursive=True)]"
py -c "import glob; import os; [os.remove(f) for f in glob.glob('**/*.py[cod]', recursive=True)]"
goto :eof
:install
py -m pip install --upgrade pip
py -m pip install -e ".[dev]"
py -m pip install black flake8 pytest pytest-cov
goto :eof
:test
py -m pytest --verbose --color=yes
goto :eof
:lint
call :lint-netgsm
call :lint-tests
call :lint-examples
goto :eof
:lint-netgsm
py scripts/lint.py netgsm
goto :eof
:lint-tests
py scripts/lint.py tests
goto :eof
:lint-examples
py scripts/lint.py examples
goto :eof
:format
call :format-netgsm
call :format-tests
call :format-examples
goto :eof
:format-netgsm
py scripts/format.py netgsm
goto :eof
:format-tests
py scripts/format.py tests
goto :eof
:format-examples
py scripts/format.py examples
goto :eof
:build
call :clean
py setup.py sdist bdist_wheel
goto :eof
:publish
call :build
py -m twine check dist/*
py -m twine upload dist/*
goto :eof