CI uv setup 실패 (#6 후속): - 원인: astral-sh/setup-uv@v3 의 enable-cache:true 가 **/uv.lock 미발견 시 fail. 7개 push 모두 ::error::No file ... matched to [**/uv.lock] → 10-20초 만에 abort. - 해결: uv.lock 생성 (438KB, 89 packages 해결) + cache-dependency-glob 명시. 연쇄 수정 (uv.lock 생성 과정에서 노출): - pyproject.toml: scipy/pyproj/numpy 핀을 hard-pin == 에서 range > = 로 완화 (base vs [py313] extras 충돌 해소). requires-python ">=3.9" → ">=3.11" (pyproj>=3.7 wheel 가용 환경과 일치). [tool.uv] no-progress = false 제거 (deprecated). - .gitea/workflows/ci.yml: 별도 Setup Python step 제거 (uv venv가 자동 fetch), install step 단순화 (matrix 분기 EXTRAS 변수), 모든 run: 에 shell: bash 명시. UI 진행률 인디케이터 (#4 부분): - self.progress_bar (CTkProgressBar mode=indeterminate, MC overlap orange #FF5F00) status_bar 우측에 hidden 배치. start_progress(label)/stop_progress() 메서드 추가. - self.textbox height 120 → 80 (인라인 로그 비중 축소, 백엔드 파일이 주 기록처). ruff cleanup (harness/perf.py): - Optional[Callable[...]] → Callable[...] | None (UP045). - try/except/pass → contextlib.suppress (SIM105). - 미사용 # noqa: BLE001 제거 (RUF100). 검증: uv lock 성공, ruff check All checks passed, py_compile + AST OK. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
95 lines
2.8 KiB
YAML
95 lines
2.8 KiB
YAML
# Gitea Actions — Red → Green 게이트.
|
|
# 피드백 #6: "Git을 이용해서 개발 cycle (Red→Green)이 완료되면 Git(s-canvas)에 자동
|
|
# 업로드 프로세스 구축 (ruff, pytest 등을 적극 활용)"
|
|
#
|
|
# 트리거: push 모든 브랜치, PR. main 브랜치는 추가 보호.
|
|
#
|
|
# Stage 구성:
|
|
# 1. ruff (린트) — 30초 미만
|
|
# 2. py_compile (전체 syntax) — 10초 미만
|
|
# 3. pytest (회귀 + 빠른 단위) — 1~2분
|
|
# 4. (선택) coverage report
|
|
#
|
|
# 모두 통과 = Green. main 브랜치는 Green 통과 시에만 push 허용 (Gitea repo 설정).
|
|
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
lint-and-test:
|
|
name: Ruff + Test (Py3.11 + Py3.13)
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: ["3.11", "3.13"]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup uv (fast Python pkg manager)
|
|
uses: astral-sh/setup-uv@v3
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: "uv.lock"
|
|
|
|
- name: Install deps
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
if [ "${{ matrix.python-version }}" = "3.13" ]; then
|
|
EXTRAS=".[py313,dev]"
|
|
else
|
|
EXTRAS=".[dev]"
|
|
fi
|
|
# uv 가 자동으로 Py 버전 fetch + .venv 생성. 별도 `uv python install`
|
|
# step 불필요 (uv venv 가 내부적으로 처리).
|
|
uv venv .venv --python ${{ matrix.python-version }}
|
|
source .venv/bin/activate
|
|
uv pip install -e "$EXTRAS"
|
|
|
|
- name: Ruff lint
|
|
shell: bash
|
|
run: |
|
|
source .venv/bin/activate
|
|
ruff check --output-format=github
|
|
|
|
- name: py_compile (전체 .py)
|
|
shell: bash
|
|
run: |
|
|
source .venv/bin/activate
|
|
python -c "
|
|
import py_compile, pathlib, sys
|
|
errs = []
|
|
for p in sorted(pathlib.Path('.').rglob('*.py')):
|
|
if any(s in str(p) for s in ('venv', '_unused', '__pycache__', '.bak')):
|
|
continue
|
|
try:
|
|
py_compile.compile(str(p), doraise=True)
|
|
except py_compile.PyCompileError as e:
|
|
errs.append((p, str(e)[:200]))
|
|
for p, m in errs:
|
|
print(f'::error file={p}::{m}')
|
|
sys.exit(1 if errs else 0)
|
|
"
|
|
|
|
- name: pytest (회귀)
|
|
shell: bash
|
|
run: |
|
|
source .venv/bin/activate
|
|
pytest -ra --tb=short -m "not slow and not integration"
|
|
|
|
- name: pytest (slow + integration, allow failure)
|
|
if: ${{ matrix.python-version == '3.13' }}
|
|
continue-on-error: true
|
|
shell: bash
|
|
run: |
|
|
source .venv/bin/activate
|
|
pytest -ra --tb=short -m "slow or integration"
|