astral-sh / astral-sh/ruff

Take Python version from the .python-version file

Open
#16,355 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

configuration wish
Dominant language
Rust
Stars
49.7k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
458

Description

Description

Why do I have to specify the target-version when I already have a .python-version file?

When I am running a Python application (not a library that will be published), then .python-version should be enough I would think. requires-python becomes mostly useless, and target-version also seems kinda redundant? But when I remove both of those then ruff will complain to me.

Contributor guide

Open the contributing guide

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.

Research direction

Start by tracing Ruff's configuration handling for .python-version, target-version, and requires-python, then inspect the related configuration tests. Done means Ruff consistently derives the target Python version from .python-version when the other settings are absent, with tests covering the application scenario described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.