Skip to content

Commit 06608ba

Browse files
committed
[infra] Modernize dev environment to use uv, ruff, and ty
1 parent 6b826b9 commit 06608ba

93 files changed

Lines changed: 1800 additions & 5667 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/Dockerfile

Lines changed: 0 additions & 80 deletions
This file was deleted.

.devcontainer/README.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 0 additions & 33 deletions
This file was deleted.

.devcontainer/py312/.devcontainer/devcontainer.json

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/pre-merge.yaml

Lines changed: 27 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,40 @@
11
name: pre-merge
22

3-
env:
4-
REGISTRY: ghcr.io
5-
IMAGE_NAME: ${{ github.repository }}
6-
73
on:
84
pull_request:
95
workflow_dispatch:
106

117
jobs:
12-
pre-merge:
8+
lint:
139
runs-on: ubuntu-24.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v5
14+
with:
15+
enable-cache: true
16+
- name: Install dependencies
17+
run: uv sync --locked
18+
- name: Ruff (format)
19+
run: uv run ruff format --check
20+
- name: Ruff (lint)
21+
run: uv run ruff check
22+
- name: ty (type check)
23+
run: uv run ty check
24+
25+
test:
26+
runs-on: ubuntu-latest
1427
strategy:
28+
fail-fast: false
1529
matrix:
16-
python-version: ["3.10", "3.12"]
17-
include:
18-
- python-version: "3.10"
19-
python-py-version: "py310"
20-
- python-version: "3.12"
21-
python-py-version: "py312"
22-
container:
23-
image: ghcr.io/${{ github.repository }}-ci:${{ matrix.python-py-version }}-poetry-bullseye
24-
credentials:
25-
username: ${{ github.actor }}
26-
password: ${{ secrets.GITHUB_TOKEN }}
27-
30+
python-version: ["3.10", "3.12", "3.14"]
2831
steps:
2932
- uses: actions/checkout@v4
30-
- name: Poetry Venv Dir
31-
run: |
32-
echo "VENV_DIR=$(poetry config virtualenvs.path)" >> $GITHUB_ENV
33-
34-
- name: Restore the Cache
35-
id: cache-deps
36-
uses: actions/cache@v4
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v5
3735
with:
38-
path: ${{ env.VENV_DIR }}
39-
# bump the suffix if you need to force-refresh the cache
40-
key: py-trees-ci-cache-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock', '**/tox.ini') }}-1
41-
42-
# Install all deps, sans the project (--no-root)
43-
- name: Poetry - Install Dependencies
44-
run: poetry install --no-interaction --no-root
45-
if: steps.cache-deps.outputs.cache-hit != 'true'
46-
47-
# Project is installed separately to avoid always invalidating the cache
48-
- name: Poetry - Install Project
49-
run: poetry install --no-interaction
50-
51-
# TODO: Caching above doesn't make much sense when tox effectively re-installs deps
52-
- name: Tox - Tests
53-
run: poetry run tox --workdir ${{ env.VENV_DIR }} -e ${{ matrix.python-py-version }}
54-
- name: Tox - Formatters, Linters
55-
run: poetry run tox --workdir ${{ env.VENV_DIR }} -e check
56-
- name: Tox - MyPy
57-
run: poetry run tox --workdir ${{ env.VENV_DIR }} -e my${{ matrix.python-py-version }}
36+
enable-cache: true
37+
- name: Install dependencies
38+
run: uv sync --locked --python ${{ matrix.python-version }}
39+
- name: Pytest
40+
run: uv run --python ${{ matrix.python-version }} pytest -s --cov=py_trees tests/

.github/workflows/push_poetry_container.yaml

Lines changed: 0 additions & 75 deletions
This file was deleted.

.github/workflows/update-poetry-cache.yaml

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)