Refuse an unsupported Python version before scaffolding

Open Beginner friendly
#704 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
Half a day
Newbie friendliness
85/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
cli, testing

Research direction

Read nexy/modules/cli/commands/new.py, nexy/modules/cli/commands/init.py, and nexy/modules/cli/init/project.py to identify the shared point before scaffolding writes files. Add the sys.version_info guard using the supported version in .python-version, and cover both new and init with focused tests for supported and unsupported interpreters. Done means the guard runs before destination creation, prints both versions and the exact uv python install command, and leaves no directory behind on failure.

Written by the indexing model from the issue text.

Description

area:cli difficulty:intermediate enhancement

Problem

No Python version guard exists in new or init. A user on an older interpreter reaches the scaffolder and fails later with a message that points nowhere near the cause.

What we know

  • nexy/modules/cli/commands/new.py lines 37 to 45 calls InitProject().run(...).
  • nexy/modules/cli/commands/init.py lines 11 to 13 calls the same orchestrator.
  • nexy/modules/cli/init/project.py lines 26 to 45 resolves the destination before any dependency work.
  • No sys.version_info check exists in nexy/.

Proposal

Check the interpreter before any file is written. On an unsupported version, print the current version, the supported version from .python-version, and the exact uv python install command that fixes it. Apply the check to both new and init. Do not start the installer from inside the guard: the user decides whether to install.

Acceptance

  • A test covers a supported version.
  • A test covers an older version and asserts the message names both versions and the fix command.
  • No directory is created when the check fails.
  • One assertion per test.
Dominant language
Python
Stars
11
Forks
6
Avg merge
2h 14m
Merged PRs (30d)
265

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NexyPy/nexy

All issues in NexyPy/nexy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.