| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e3f240d commit 6bcb874
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,21 +7,14 @@ Thanks for your interest in contributing. This repository contains the PythonNat | |||
| 7 | 7 | Development uses Python ≥ 3.10. | |
| 8 | 8 | ||
| 9 | 9 | ```bash | |
| 10 | - # create and activate a venv (recommended) | ||
| 11 | - python3 -m venv .venv && source .venv/bin/activate | ||
| 10 | + # one-shot: creates .venv, syncs CI deps, runs every CI check | ||
| 11 | + # (requires uv: https://docs.astral.sh/uv/getting-started/installation/) | ||
| 12 | + ./scripts/check.sh | ||
| 12 | 13 | ||
| 13 | - # install dev tools (lint/format/test) | ||
| 14 | - pip install -e ".[dev]" | ||
| 15 | - | ||
| 16 | - # install library (editable) and CLI | ||
| 17 | - pip install -e . | ||
| 18 | - | ||
| 19 | - # run tests | ||
| 14 | + # Run individual steps if you only want one | ||
| 20 | 15 | pytest -q | |
| 21 | - | ||
| 22 | - # format and lint | ||
| 23 | - black src examples tests || true | ||
| 24 | 16 | ruff check . | |
| 17 | + black src examples tests | ||
| 25 | 18 | ``` | |
| 26 | 19 | ||
| 27 | 20 | Common library and CLI entry points: | |
@@ -63,6 +56,7 @@ cd examples/hello-world && pn run android | |||
| 63 | 56 | Common commands: | |
| 64 | 57 | ||
| 65 | 58 | ```bash | |
| 59 | + ./scripts/check.sh # run all CI checks (mirrors ci.yml) | ||
| 66 | 60 | pytest -q # run tests | |
| 67 | 61 | ruff check . # lint | |
| 68 | 62 | black src examples tests # format | |
@@ -127,6 +121,7 @@ Recommended scopes (choose the smallest, most accurate unit; prefer module/direc | |||
| 127 | 121 | - `mkdocs` – documentation site (MkDocs/Material) configuration and content under `docs/` | |
| 128 | 122 | - `pyproject` – `pyproject.toml` packaging/build metadata | |
| 129 | 123 | - `repo` – repository metadata and top‑level files (`README.md`, `CONTRIBUTING.md`, `.gitignore`, licenses) | |
| 124 | + - `scripts` – developer scripts under `scripts/` (e.g., `check.sh`) | ||
| 130 | 125 | - `templates` – Android/iOS project templates under `src/pythonnative/templates/` | |
| 131 | 126 | - `tests` – unit/integration/E2E tests under `tests/` | |
| 132 | 127 | - `workflows` – CI pipelines under `.github/workflows/` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,52 @@ | |||
| 1 | + #!/usr/bin/env bash | ||
| 2 | + # Run the same checks as .github/workflows/ci.yml locally, in the same order. | ||
| 3 | + # Stops at the first failure. If this script is green, CI should be green too. | ||
| 4 | + # | ||
| 5 | + # Uses uv to manage the project venv and CI dependencies. Install uv first: | ||
| 6 | + # curl -LsSf https://astral.sh/uv/install.sh | sh | ||
| 7 | + # | ||
| 8 | + # Usage: | ||
| 9 | + # ./scripts/check.sh | ||
| 10 | + | ||
| 11 | + set -euo pipefail | ||
| 12 | + | ||
| 13 | + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| 14 | + ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" | ||
| 15 | + cd "$ROOT_DIR" | ||
| 16 | + | ||
| 17 | + if ! command -v uv > /dev/null; then | ||
| 18 | + echo "Error: 'uv' is not installed." >&2 | ||
| 19 | + echo "Install: https://docs.astral.sh/uv/getting-started/installation/" >&2 | ||
| 20 | + exit 1 | ||
| 21 | + fi | ||
| 22 | + | ||
| 23 | + if [[ ! -x ".venv/bin/python" ]]; then | ||
| 24 | + printf "\n==> Creating .venv (uv venv --seed)\n" | ||
| 25 | + uv venv --seed | ||
| 26 | + fi | ||
| 27 | + | ||
| 28 | + printf "\n==> Syncing CI dependencies\n" | ||
| 29 | + uv pip install --python .venv/bin/python -e ".[ci]" build | ||
| 30 | + | ||
| 31 | + PY=".venv/bin/python" | ||
| 32 | + | ||
| 33 | + step() { | ||
| 34 | + printf "\n==> %s\n" "$1" | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + step "Lint (Ruff)" | ||
| 38 | + "$PY" -m ruff check . | ||
| 39 | + | ||
| 40 | + step "Format check (Black)" | ||
| 41 | + "$PY" -m black --check src examples tests | ||
| 42 | + | ||
| 43 | + step "Type check (MyPy)" | ||
| 44 | + "$PY" -m mypy --install-types --non-interactive | ||
| 45 | + | ||
| 46 | + step "Build package (sdist + wheel)" | ||
| 47 | + "$PY" -m build | ||
| 48 | + | ||
| 49 | + step "Run tests (pytest)" | ||
| 50 | + "$PY" -m pytest -q | ||
| 51 | + | ||
| 52 | + printf "\nAll CI checks passed.\n" | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments