Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ on:

jobs:
build:
name: ${{ matrix.os }} py${{ matrix.python-version }}
name: ${{ matrix.os }} py${{ matrix.python-version }}${{ format(' ({0})', matrix.resolution)}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.14']
resolution: ['lowest', 'highest']

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -55,9 +56,9 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-py${{ matrix.python-version }}-uv-${{ hashFiles('**/pyproject.toml') }}
key: ${{ runner.os }}-py${{ matrix.python-version }}-uv-${{ matrix.resolution }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-py${{ matrix.python-version }}-uv-
${{ runner.os }}-py${{ matrix.python-version }}-uv-${{ matrix.resolution }}-

- name: Set up uv
run: |
Expand All @@ -68,12 +69,10 @@ jobs:
run: |
uv tool install prysk

- name: Set up jgo
run: |
uv tool install --with-editable ".[cli]" jgo

- name: Run tests
shell: bash
env:
UV_RESOLUTION: ${{ matrix.resolution }}
run: |
bin/test.sh

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ help:
docs - build documentation site locally\n\
lint - run code formatters and linters\n\
test - run automated test suite\n\
test-lowest - run tests with lowest dependency resolution\n\
dist - generate release archives\n\
"

Expand All @@ -22,7 +23,10 @@ lint: check
test: check
bin/test.sh

test-lowest: check
UV_RESOLUTION=lowest bin/test.sh

dist: check clean
bin/dist.sh

.PHONY: help clean docs check lint test dist
.PHONY: help clean docs check lint test test-lowest dist
18 changes: 0 additions & 18 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,5 @@ if [ ${#pytest_args[@]} -gt 0 ]; then
fi
fi

# Run prysk if we have args and prysk is installed
if [ ${#prysk_args[@]} -gt 0 ] && command -v prysk; then
# NB: We cannot add prysk to pyproject.toml because
# prysk depends on an incompatible version of rich.
# Use `uv tool install prysk` instead.
#
# We set COLOR=never by default to avoid ANSI codes in test output.
# We set NO_PROGRESS=1 to disable progress bars in test output.
# This is especially important for CI, which may or may not detect
# as ANSI-color-compatible compared to local usage of prysk.
# Tests can override this (e.g., color.t does).
COLOR="${COLOR:-never}" NO_PROGRESS="${NO_PROGRESS:-1}" prysk -v "${prysk_args[@]}"
prysk_status=$?
if [ $prysk_status -ne 0 ]; then
exit_status=$prysk_status
fi
fi

# Exit with appropriate status
exit $exit_status
34 changes: 16 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,32 @@ classifiers = [
requires-python = ">=3.10"
dependencies = [
"cjdk>=0.4.0",
"psutil",
"requests",
"psutil>=7",
# Previous versions vendored urllib3/packages/six.py, resulting in failures
"requests>=2.16.0",
"semver>=3.0.0",
"tomli>=2.0.0; python_version<'3.11'",
"tomli-w>=1.0.0",
]

[project.optional-dependencies]
cli = [
"rich>=14.2.0",
"rich-click>=1.9.5",
"urllib3>=2",
]

[dependency-groups]
cli = [
"rich>=14.2.0",
"rich>=13.3.1",
"rich-click>=1.9.5",
]
dev = [
"build",
"mypy",
"pytest",
"ruff",
"types-Pygments",
"types-colorama",
"types-psutil",
"types-requests",
"validate-pyproject[all]",
"build>=1.2.2",
"mypy>=1.20.2",
"prysk>=0.20.0",
"pytest>=9.0.3",
"pytest-prysk>=0.4.0",
"ruff>=0.15.12",
"types-Pygments>=2.20.0",
"types-colorama>=0.4.15",
"types-psutil>=7.2.2",
"types-requests>=2.33.0",
"validate-pyproject[all]>=0.25",
{include-group = "cli"},
]

Expand Down
15 changes: 15 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Pytest configuration and shared fixtures."""

import os
import shutil
import subprocess
from pathlib import Path
Expand All @@ -12,6 +13,20 @@
_BOOTSTRAP_SENTINEL = Path(".cache/m2_repo/.bootstrapped")


@pytest.fixture(scope="session", autouse=True)
def prysk_env():
"""Set default env vars for prysk tests, matching the old shell script invocation."""
old = {k: os.environ.get(k) for k in ("COLOR", "NO_PROGRESS")}
os.environ.setdefault("COLOR", "never")
os.environ.setdefault("NO_PROGRESS", "1")
yield
for k, v in old.items():
if v is None:
os.environ.pop(k, None)
else:
os.environ[k] = v


@pytest.fixture(scope="session")
def thicket_poms(tmp_path_factory):
"""
Expand Down
Loading