Skip to content
Merged
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
3 changes: 0 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ This guide covers local development for `posit-cli`. End-user installation and C
Install these tools before starting:

- Git
- Python 3.8 or newer
- Python 3.11 or newer
- [uv](https://docs.astral.sh/uv/)
- [just](https://github.com/casey/just)

The project uses uv for dependency management and virtual environments. The supported Python versions are 3.8 through 3.14, which are tested in CI.
The project uses uv for dependency management and virtual environments. The supported Python versions are 3.11 through 3.14, which are tested in CI. posit-cli follows rsconnect-python's [Python support policy](https://github.com/posit-dev/rsconnect-python/blob/main/docs/adr/0001-support-only-non-eol-python.md): it supports only Python versions that haven't reached end-of-life, and drops each one in the next minor release after its EOL date.

## Set Up

Expand Down Expand Up @@ -48,7 +48,7 @@ Run these commands from the repository root:
| `just deps` | Sync runtime, test, and lint dependencies from `uv.lock`. |
| `just dev` | Install the checkout as an editable uv tool. |
| `just test` | Run tests against Python 3.13. |
| `just test 3.8` | Run tests against a specific Python version. |
| `just test 3.12` | Run tests against a specific Python version. |
| `just lint` | Check formatting and run Ruff. |
| `just fmt` | Format files and apply Ruff fixes. |
| `just build` | Build the wheel and source distribution in `dist/`. |
Expand Down Expand Up @@ -82,7 +82,7 @@ just build
just smoke
```

CI also runs the test suite against Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14. Add or update tests when changing behavior, and update user-facing documentation in `README.md` when the CLI changes.
CI also runs the test suite against Python 3.11, 3.12, 3.13, and 3.14. Add or update tests when changing behavior, and update user-facing documentation in `README.md` when the CLI changes.

Keep commits focused and use Conventional Commit messages, such as `fix: handle expired Connect tokens` or `docs: clarify local setup`.

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ name = "posit-cli"
dynamic = ["version"]
description = "A single, friendly command-line interface for Posit Connect, in the spirit of gh."
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.11"
license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Posit Software, PBC" }]
dependencies = [
# posit-cli reuses rsconnect-python's *internal* API (RSConnectExecutor,
# RSConnectClient). These have no stability contract, so re-verify the internals
# on bumps. See tests/test_rsconnect_contract.py.
"rsconnect-python>=1.33,<2",
"rsconnect-python>=1.34,<2",
# rsconnect imports `keyring` optionally; we depend on it directly so OAuth
# tokens land in the OS keyring.
"keyring>=23.0",
Expand Down
22 changes: 9 additions & 13 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,21 +256,17 @@ def test_include_on_error_still_exits_nonzero(runner):
assert "nope" in result.output


def test_include_jq_runtime_error_leaks_nothing_to_stdout(runner):
# A jq runtime failure on a 2xx response must abort before emitting headers,
# so a failed command never leaks partial output (headers) to stdout.
def test_include_jq_runtime_error_leaks_nothing_to_stdout(capsys):
resp = _http_response(status=200, reason="OK", body=json.dumps({"username": "neal"}))
with patch("posit_cli.connect.api.RSConnectExecutor") as Executor:
ce = Executor.return_value
ce.client.request.return_value = resp
result = runner.invoke(cli, ["connect", "api", "v1/user", "-i", "-q", 'error("boom")'])
assert result.exit_code != 0
# Checked against combined output, not result.stdout/.stderr separately:
# Click's CliRunner only captures those on separate streams in >=8.2
# (older click, still resolved for our py3.8/3.9 floor, always mixes them).
assert "HTTP/" not in result.output # no header lines leaked
assert "neal" not in result.output # no body leaked
assert "jq: boom" in result.output
Executor.return_value.client.request.return_value = resp
with pytest.raises(SystemExit) as exc:
cli.main(["connect", "api", "v1/user", "-i", "-q", 'error("boom")'], prog_name="posit")

captured = capsys.readouterr()
assert exc.value.code == 1
assert captured.out == ""
assert captured.err == "Error: jq: boom\n"


def _paginated_invoke(runner, args, pages):
Expand Down
Loading