Compare commits
6 Commits
main
...
chore-upda
| Author | SHA1 | Date | |
|---|---|---|---|
| 66dcf9bcd2 | |||
| 612a5c152d | |||
| 03c42dcd68 | |||
| e215ba489a | |||
| 4e1233e9e9 | |||
| 804e15d764 |
78
.drone.yml
78
.drone.yml
@@ -1,48 +1,74 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: python-ci
|
name: python-uv-ci
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event: [ push, pull_request ]
|
event: [ push, pull_request ]
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: uv-cache
|
||||||
|
temp: {}
|
||||||
|
- name: uv-home
|
||||||
|
temp: {} # persists ~/.local (uv tool shims/envs) across steps in this run
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: setup+deps
|
- name: lint+typecheck
|
||||||
image: python:3.12-slim
|
image: python:3.13-slim
|
||||||
|
volumes:
|
||||||
|
- name: uv-cache
|
||||||
|
path: /root/.cache/uv
|
||||||
|
- name: uv-home
|
||||||
|
path: /root/.local
|
||||||
environment:
|
environment:
|
||||||
UV_NO_SYNC_PROGRESS: "1"
|
UV_NO_SYNC_PROGRESS: "1"
|
||||||
commands:
|
commands:
|
||||||
- python -V
|
|
||||||
- apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
|
- apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- export PATH="$HOME/.local/bin:$PATH"
|
||||||
# pick python version (use .python-version if present, else 3.12)
|
- uv python install 3.13
|
||||||
- PYVER="$( [ -f .python-version ] && cat .python-version || echo 3.12 )"
|
- uv sync --all-extras --dev
|
||||||
- uv python install "$PYVER"
|
# install CLI tools (ruff not bundled by default)
|
||||||
- uv venv .venv
|
- uv tool install ruff
|
||||||
- . .venv/bin/activate
|
- uv tool install mypy
|
||||||
# install project + dev tools
|
- ruff --version
|
||||||
- |
|
- mypy --version
|
||||||
if [ -f pyproject.toml ] && grep -q "\[tool\.uv\]" pyproject.toml; then
|
|
||||||
uv sync --all-extras --dev
|
|
||||||
else
|
|
||||||
uv pip install -e ".[dev]" || true
|
|
||||||
if [ -f requirements.txt ]; then uv pip install -r requirements.txt; fi
|
|
||||||
fi
|
|
||||||
- uv pip install pytest pytest-cov mypy ruff
|
|
||||||
|
|
||||||
- name: lint-typecheck
|
|
||||||
image: python:3.12-slim
|
|
||||||
commands:
|
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
- . .venv/bin/activate
|
|
||||||
- ruff check .
|
- ruff check .
|
||||||
- mypy --ignore-missing-imports .
|
- mypy --ignore-missing-imports .
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: python:3.12-slim
|
image: python:3.13-slim
|
||||||
|
volumes:
|
||||||
|
- name: uv-cache
|
||||||
|
path: /root/.cache/uv
|
||||||
|
- name: uv-home
|
||||||
|
path: /root/.local
|
||||||
|
environment:
|
||||||
|
UV_NO_SYNC_PROGRESS: "1"
|
||||||
commands:
|
commands:
|
||||||
|
- apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
|
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- export PATH="$HOME/.local/bin:$PATH"
|
||||||
- . .venv/bin/activate
|
- uv python install 3.13
|
||||||
|
- uv sync --all-extras --dev
|
||||||
|
# tools already installed in previous step; safe to re-run for idempotency
|
||||||
|
- uv add pytest pytest-cov
|
||||||
- pytest -q --maxfail=1 --disable-warnings --cov --cov-report=term-missing
|
- pytest -q --maxfail=1 --disable-warnings --cov --cov-report=term-missing
|
||||||
|
|
||||||
|
- name: build-wheel
|
||||||
|
image: python:3.13-slim
|
||||||
|
volumes:
|
||||||
|
- name: uv-cache
|
||||||
|
path: /root/.cache/uv
|
||||||
|
- name: uv-home
|
||||||
|
path: /root/.local
|
||||||
|
environment:
|
||||||
|
UV_NO_SYNC_PROGRESS: "1"
|
||||||
|
commands:
|
||||||
|
- apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
|
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
- export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
- uv python install 3.13
|
||||||
|
- uv sync --all-extras --dev
|
||||||
|
- uv build
|
||||||
|
- ls -lh dist
|
||||||
|
|||||||
Reference in New Issue
Block a user