Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mypy (running in 3.10) complains that positional-only parameters are only supported in 3.8+ #13639

Closed
hjwp opened this issue Sep 9, 2022 · 5 comments
Labels
bug mypy got something wrong

Comments

@hjwp
Copy link

hjwp commented Sep 9, 2022

Bug Report

To Reproduce

reporting based on current project, will try and find time for a minimal repro later, but in short:

  • a python3.10 virtualenv with mypy and numpy (specific versions below)
  • start mypy

Actual Behavior

👉  mypy /path/to/my_file.py
.venv/lib/python3.10/site-packages/numpy/__init__.pyi:642: error: Positional-only parameters are only supported in Python 3.8 and greater
Found 1 error in 1 file (errors prevented further checking)

I did also try adding an explict --python-version 3.10 flag, same result.

Your Environment

debian

  • Mypy version used: mypy 0.971 (compiled: yes)
  • Mypy command-line flags: (none)
  • Mypy configuration options from mypy.ini (and other config files):
[tool.mypy]

[[tool.mypy.overrides]]
module = [
    "trimesh",
    "gmsh",
    "pyembree.*",
    "scipy.*",  # TODO: surely there are stubs for scipy somewhere?
]
ignore_missing_imports = true
  • Python version used: Python 3.10.7
  • Operating system and version: Debian bullseye
  • numpy version 1.22.3
@hjwp hjwp added the bug mypy got something wrong label Sep 9, 2022
@AlexWaygood
Copy link
Member

AlexWaygood commented Sep 9, 2022

Duplicate of #13499, #13635, #13627. A fix will hopefully be out soon. Your best bet is to pin to Python 3.10.6 (not 3.10.7) until a mypy release with the fix is out.

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2022
@hjwp
Copy link
Author

hjwp commented Sep 12, 2022

I'm so sorry, i should have searched more thoroughly for existing bugs. thanks for your help!

Azulinho added a commit to Azulinho/cryptobot that referenced this issue Dec 12, 2022
Azulinho added a commit to Azulinho/cryptobot that referenced this issue Dec 12, 2022
Azulinho added a commit to Azulinho/cryptobot that referenced this issue Dec 12, 2022
@TheNewThinkTank
Copy link

I am hit by the same issue. Running mypy from GitHub Actions, with Python 3.11, on ubuntu-latest. Link to failed run: https://github.com/TheNewThinkTank/Fitness-Tracker/actions/runs/4908617686/jobs/8764498089

@AlexWaygood
Copy link
Member

AlexWaygood commented May 7, 2023

I am hit by the same issue. Running mypy from GitHub Actions, with Python 3.11, on ubuntu-latest. Link to failed run: https://github.com/TheNewThinkTank/Fitness-Tracker/actions/runs/4908617686/jobs/8764498089

Looks like you're using a very old mypy: https://github.com/TheNewThinkTank/Fitness-Tracker/blob/422145d17167119d3a4bba75ed24548dcbeba50f/pyproject.toml#L12

Maybe try updating to the latest version (1.2.0)? :)

We fix bugs in every release of mypy. We don't backport bugfixes to older versions.

@TheNewThinkTank
Copy link

TheNewThinkTank commented May 7, 2023

@AlexWaygood Thank you for the quick response. Updating mypy to version 1.2 fixed my issue.
for reference, https://github.com/TheNewThinkTank/Fitness-Tracker/actions/runs/4908775462/jobs/8764752729

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants