Skip to content

Vera CLI's /dev/stdin is Unix-only — add Windows-compatible stdin handling #640

@aallan

Description

@aallan

Origin: Surfaced when the Windows CI matrix entries (added in PR #639 closing #637) ran for the first time. 6 tests in tests/test_cli.py::TestStdinInput::* fail on Windows with Error: file not found: /dev/stdin.

The pattern

Vera's CLI supports vera <subcommand> /dev/stdin as a way to read source from stdin (an alternative to the - convention used by some other CLIs). /dev/stdin is a Unix-specific path — Windows doesn't have it.

Failing tests:

  • test_check_reads_source_once
  • test_run_dev_stdin_subprocess
  • test_verify_dev_stdin_subprocess
  • test_compile_dev_stdin_wat
  • test_compile_dev_stdin_default_output
  • test_check_dev_stdin_module_resolution

All hit the same shape:

CompletedProcess(args=['python.exe', '-m', 'vera.cli', 'check', '/dev/stdin'],
                 returncode=1, stderr='Error: file not found: /dev/stdin\n')

Recommended fix

Two parts:

  1. CLI: add Windows-compatible stdin handling. Either (a) special-case - as a stdin sentinel (Unix convention), (b) detect /dev/stdin on Windows and silently route to sys.stdin, or (c) add a dedicated --stdin flag. Option (a) is most idiomatic across CLI tools; option (b) is most backward-compatible (existing /dev/stdin users on Unix keep working, Windows just learns to handle it).

  2. Tests: parametrize over the stdin sentinel. tests/test_cli.py::TestStdinInput should test both /dev/stdin (Unix) and whichever sentinel is chosen for Windows (- or whatever). On Windows, the /dev/stdin parameterisation should pytest.skip("Unix-only").

Out of scope

  • Renaming or deprecating /dev/stdin support on Unix. Keep it for backward compatibility.
  • Other Unix-only paths in the CLI (e.g. /dev/null). If they show up as Windows test failures, file separately.

Acceptance criteria

  • All 6 tests in tests/test_cli.py::TestStdinInput pass on windows-latest, 3.{11,12,13} after the fix.
  • Existing /dev/stdin invocations on Unix continue to work.

Pairs with

Metadata

Metadata

Assignees

No one assigned

    Labels

    windowsOS-specific to Windows

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions