Skip to main content

Release Gate

Challenge on lesson: Checkpoint: Ship-Readiness

Implement release_gate(pyproject_text, argv) that: (1) parses the TOML and raises ValueError('missing name') if [project].name is absent; (2) routes argv through a main-style dispatch: argv[0] == 'version' prints the version and returns 0; anything else returns 2 after printing an error to stderr; (3) if the dependencies list contains a bare (unpinned) name, raise ValueError('unpinned: <name>'). Return the dispatch exit code.

Difficulty: intermediate

Back to lesson: Checkpoint: Ship-Readiness