File: make.cmd

package info (click to toggle)
python-holidays 0.78-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 54,836 kB
  • sloc: python: 106,063; javascript: 85; makefile: 59
file content (91 lines) | stat: -rw-r--r-- 2,329 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
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
91
@Echo Off
SetLocal EnableDelayedExpansion

Set Target=%~1

Set Targets=
For /F "Delims=:" %%I in ('FindStr /R "^:" "%~f0"') Do Set Targets=!Targets! %%I
For %%A in (!Targets!) Do (
    If /I "%Target%"=="%%A" Call :%%A & Exit /B
)
GoTo :Help

:Check
    Call :L10n
    Call :Pre-commit
    Call :Doc
    Call :Test
    Exit /B

:Clean
    Del /S /Q *.mo
    Del /S /Q *.pyc
    RD /S /Q .mypy_cache
    RD /S /Q .pytest_cache
    RD /S /Q dist
    Exit /B

:Doc
    mkdocs build
    Exit /B

:Help
    Echo Usage: make ^<Target^>
    Echo     check         run pre-commit and tests
    Echo     doc           run documentation build process
    Echo     help          show summary of available commands
    Echo     l10n          update .pot and .po files
    Echo     package       build package distribution
    Echo     pre-commit    run pre-commit against all files
    Echo     setup         setup development environment
    Echo     test          run tests (in parallel)
    Echo     tox           run tox (in parallel)
    Exit /B

:L10n
    python scripts\l10n\generate_po_files.py 2>nul >nul
    python scripts\l10n\generate_mo_files.py
    Exit /B

:Package
    python scripts\l10n\generate_mo_files.py
    python -m build
    Exit /B

:Pre-commit
    pre-commit run --all-files
    Exit /B

:Release-notes
    python scripts\generate_release_notes.py
    Exit /B

:Sbom
    python -m cyclonedx_py requirements requirements\runtime.txt
    Exit /B

:Setup
    pip install --upgrade pip
    pip install --requirement requirements\dev.txt
    pip install --requirement requirements\docs.txt
    pip install --requirement requirements\runtime.txt
    pip install --requirement requirements\tests.txt
    pre-commit install --hook-type pre-commit
    pre-commit install --hook-type pre-push
    Call :L10n
    Call :Package
    Exit /B

:Snapshot
    python scripts\l10n\generate_mo_files.py
    python scripts\generate_snapshots.py
    Exit /B

:Test
    python scripts\l10n\generate_mo_files.py
    pytest --cov=. --cov-config=pyproject.toml --cov-report term-missing --cov-report xml --durations 10 --durations-min=0.75 --dist loadscope --no-cov-on-fail --numprocesses auto
    Exit /B

:Tox
    tox --parallel auto
    Exit /B