diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4538e90..018f221 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 @@ -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: | @@ -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 diff --git a/Makefile b/Makefile index ed6f369..865976c 100644 --- a/Makefile +++ b/Makefile @@ -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\ " @@ -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 diff --git a/bin/test.sh b/bin/test.sh index 940ceb5..d426b2d 100755 --- a/bin/test.sh +++ b/bin/test.sh @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 2820d8e..d3a8872 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"}, ] diff --git a/tests/conftest.py b/tests/conftest.py index 93838ad..f8df3df 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,6 @@ """Pytest configuration and shared fixtures.""" +import os import shutil import subprocess from pathlib import Path @@ -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): """