Skip to content

Friendlier error when 3.10 is parsed as float in pyproject.toml #12108

Closed
@jamesbraza

Description

@jamesbraza

Bug Report

Running mypy with Python 3.10 and python_version in the config file has a few wrong behaviors:

  1. It lists mypy must be 3.4 or higher (it should say 3.6)
  2. It truncates Python 3.10 to 3.1
  3. It outputs a message when there shouldn't be one (you can invoke mypy with Python 3.10)

To Reproduce

Here is a subset of my pyproject.toml:

[tool.mypy]
# SEE: http://mypy.readthedocs.io/en/latest/config_file.html#config-file

# Specifies the Python version used to parse and check the target program.
python_version = 3.10

# Enables PEP 420 style namespace packages.
namespace_packages = true

I invoke mypy via: mypy -p namespacepkg

Expected Behavior

Not to raise this message.

Actual Behavior

pyproject.toml: [mypy]: python_version: Python 3.1 is not supported (must be 3.4 or higher)

Your Environment

  • Mypy version used: 0.931
  • Mypy command-line flags: n/a
  • Mypy configuration options from mypy.ini (and other config files): see above pyproject.toml
  • Python version used: 3.10.2
  • Operating system and version: macOS v11.5.1 Big Sur

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions