Skip to content
Draft
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
4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ jobs:
python -m pip install --upgrade pip
python -m pip install uv

- name: Set up prysk
run: |
uv tool install prysk

- name: Set up jgo
run: |
uv tool install --with-editable ".[cli]" jgo
Expand Down
63 changes: 5 additions & 58 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,8 @@
dir=$(dirname "$0")
cd "$dir/.."

pytest_args=()
prysk_args=()

if [ $# -eq 0 ]; then
# No args: run both on tests directory
pytest_args+=("tests")
prysk_args+=("tests")
else
# Partition args: .py and ::* go to pytest, .t to prysk, others to both
for arg in "$@"; do
case "$arg" in
*.py|*::*)
pytest_args+=("$arg")
;;
*.t)
prysk_args+=("$arg")
;;
*)
# Flags or directories - add to both
pytest_args+=("$arg")
prysk_args+=("$arg")
;;
esac
done
fi

# Track overall exit status
exit_status=0

# Run pytest if we have args
if [ ${#pytest_args[@]} -gt 0 ]; then
uv run python -m pytest -v -p no:faulthandler "${pytest_args[@]}"
pytest_status=$?
if [ $pytest_status -ne 0 ]; then
exit_status=$pytest_status
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
# COLOR/NO_PROGRESS defaults keep prysk (.t) test output clean of ANSI codes
# and progress bars. Individual tests can override (e.g. color.t sets its own
# COLOR). The -p no:faulthandler flag avoids spurious warnings on some platforms.
COLOR="${COLOR:-never}" NO_PROGRESS="${NO_PROGRESS:-1}" \
uv run python -m pytest -v -p no:faulthandler "${@:-tests}"
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ cli = [
dev = [
"build",
"mypy",
"pytest-prysk",
"pytest",
"ruff",
"types-Pygments",
Expand Down Expand Up @@ -103,6 +104,10 @@ extend-ignore = ["E203"]
# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
"__init__.py" = ["E402", "F401"]

[tool.uv]
# prysk>=0.15 declares rich<14, but rich 14 is compatible with prysk's usage.
override-dependencies = ["rich>=14.2.0"]

[tool.pytest.ini_options]
filterwarnings = [
"ignore::DeprecationWarning",
Expand Down
2 changes: 1 addition & 1 deletion tests/cli/example.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GC shorthand (e.g., gc = "G1") must be normalized to -XX:+UseG1GC.
Dotted property names (e.g., app.name = "foo" under [java.properties]) must
be flattened to -Dapp.name=foo, not passed as -Dapp={'name': 'foo'}.

$ mkdir -p "$TMPDIR/jgo-example-test" && cd "$TMPDIR/jgo-example-test"
$ mkdir -p "jgo-example-test" && cd "jgo-example-test"
$ cat > jgo.toml << 'EOF'
> [environment]
> name = "test-app"
Expand Down
8 changes: 4 additions & 4 deletions tests/cli/init.t
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Test bare init (no endpoint) creates an empty environment.
$ jgo --dry-run init
[DRY-RUN] Would create jgo.toml:

name = "init.t"
name = ".*" (re)


coordinates = []
Expand All @@ -46,7 +46,7 @@ Test init with --dry-run.
$ jgo --dry-run init org.python:jython-standalone:2.7.4
[DRY-RUN] Would create jgo.toml:

name = "init.t"
name = ".*" (re)
description = "Generated from org.python:jython-standalone:2.7.4"


Expand Down Expand Up @@ -76,7 +76,7 @@ Test init with -r requirements file (bare init).
$ jgo --dry-run init -r reqs.txt
[DRY-RUN] Would create jgo.toml:

name = "init.t"
name = ".*" (re)


coordinates = [
Expand All @@ -93,7 +93,7 @@ Test init with -r requirements file and endpoint.
$ jgo --dry-run init org.python:jython-standalone:2.7.4 -r reqs.txt
[DRY-RUN] Would create jgo.toml:

name = "init.t"
name = ".*" (re)
description = "Generated from org.python:jython-standalone:2.7.4"


Expand Down
Loading