-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
123 lines (108 loc) · 2.56 KB
/
pyproject.toml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
[project]
name = "ocp-diag-result-viewer"
version = "0.0.1"
description = ""
authors = [
{name = "meltan-core-team", email = "[email protected]"},
]
dependencies = [
"bs4>=0.0.1",
"click>=8.1.3",
"immutabledict>=2.2.3",
"tabulate>=0.9.0",
"Flask>=2.2.3",
"gunicorn>=20.1.0",
"google-cloud-storage>=2.8.0",
"google-cloud-secret-manager==2.1.0",
"python-dotenv>=1.0.0",
"toml>=0.10.2",
"authlib>=1.2.1",
]
requires-python = ">=3.10,<3.11"
license = {text = "MIT"}
[build-system]
requires = ["pdm-pep517"]
build-backend = "pdm.pep517.api"
[tool.pdm]
[tool.pdm.dev-dependencies]
dev = [
"tox-pdm>=0.6.1",
"pytest>=7.2.1",
"requests-mock>=1.10.0",
"pdm-packer>=0.6.0",
]
lint = [
"black>=22.12.0",
"flake8>=6.0.0",
"isort>=5.11.4",
]
[tool.pdm.build]
includes = [
"viewer/",
]
[tool.pdm.scripts]
[tool.pdm.scripts.client]
call = "viewer.client.cli:main"
env = {PYTHONDONTWRITEBYTECODE = "1"}
[tool.pdm.scripts.client-build]
shell = """
mkdir -p {args:.}/bin && pdm pack -m viewer.client.cli:main -c --compile --exe -o {args:.}/bin/ocp-diag-result-viewer -i '/usr/bin/env python3'
"""
[tool.pdm.scripts.test]
shell = """
pytest tests
"""
[tool.pdm.scripts.lint]
shell = """
set -e
echo "=> lint: isort"
isort --check viewer
echo "=> lint: black"
black --check viewer
echo "=> lint: flake8"
flake8 viewer
"""
[tool.pdm.scripts.format]
shell = """
isort viewer
black viewer
"""
[tool.isort]
profile = "black"
line_length = 80
[tool.black]
line-length = 80
[tool.pdm.scripts.remove-static-for-client]
call = "viewer.client.remove_static_path:remove_static_path"
[tool.pdm.scripts.frontend-build]
shell = """
cd frontend
npm install
npm run build
cd ../
mkdir -p viewer/server/templates/
cp static/index.html viewer/server/templates/index.html
mkdir -p viewer/client/files
cp static/index.html viewer/client/files/index.html
cp static/main.js viewer/client/files/main.js
cp static/polyfills.js viewer/client/files/polyfills.js
cp static/runtime.js viewer/client/files/runtime.js
cp static/styles.css viewer/client/files/styles.css
pdm run remove-static-for-client
"""
[tool.pdm.scripts.gae-deploy-build]
shell = """
pdm run frontend-build
pdm install --prod
pdm export --prod -o requirements.txt
"""
[tool.pdm.scripts.gae-deploy]
shell = """
pdm run gae-deploy-build
gcloud app deploy -q
"""
[tool.pdm.scripts.server]
shell = """
pdm run frontend-build
flask --app 'viewer.server.main:app' run {args}
"""