forked from LeyckerS/moondownloader
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (92 loc) · 2.92 KB
/
Copy pathlint.yml
File metadata and controls
111 lines (92 loc) · 2.92 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Lint
on:
push:
branches: [main]
paths:
- "**.py"
- "requirements.txt"
- "constraints.txt"
- ".github/dependabot.yml"
- ".github/workflows/lint.yml"
pull_request:
paths:
- "**.py"
- "requirements.txt"
- "constraints.txt"
- ".github/dependabot.yml"
- ".github/workflows/lint.yml"
jobs:
syntax-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Byte-compile every module
run: git ls-files '*.py' | xargs python -m compileall -q
ruff:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Install ruff
run: pip install "ruff==0.16.1"
- name: Lint with ruff
run: ruff check .
dependency-contract:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.10"
- name: Verify every runtime dependency has an upper bound
run: |
python - <<'PY'
from pathlib import Path
missing = []
for raw_line in Path("requirements.txt").read_text().splitlines():
line = raw_line.split("#", 1)[0].strip()
if line and "<" not in line:
missing.append(line)
if missing:
raise SystemExit(f"runtime dependencies without upper bounds: {missing}")
PY
- name: Install latest compatible dependencies
run: |
python -m venv /tmp/moon-unconstrained
/tmp/moon-unconstrained/bin/pip install -r requirements.txt
/tmp/moon-unconstrained/bin/pip check
- name: Install the tested constrained set
run: |
python -m venv /tmp/moon-constrained
/tmp/moon-constrained/bin/pip install -r requirements.txt -c constraints.txt
/tmp/moon-constrained/bin/pip check
no-chrome:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.10"
# Chrome and the network are stubbed at the moon_extract boundary, so this
# job needs neither a browser nor a display -- only the engine's own imports.
- name: Install engine dependencies
run: pip install "aiohttp>=3.9,<4" "curl_cffi>=0.7,<1" "pytest==8.*"
- name: A fuckingfast batch must not open a browser
run: pytest tests/ -q