refurb icon indicating copy to clipboard operation
refurb copied to clipboard

[Bug]: python_version + multi-py-version library

Open kasium opened this issue 1 year ago • 4 comments

Has your issue already been fixed?

  • [X] Have you checked to see if your issue still exists on the master branch? See the docs for instructions on how to setup a local build of Refurb.
  • [X] Have you looked at the open/closed issues to see if anyone has already reported your issue?
  • [X] If reporting a false positive/incorrect suggestion, have you double checked that the suggested fix changes the code semantics?

The Bug

Given a multi-py-version library (a library which e..g support python 3.8-3.12), using refurbs python-version can lead to issues. In my case, my documentation which is only generated with python 3.12 contains a custom sphinx plugin. The latest version of sphinx is only compatible with py 3.8 onwards but now refurb complains:

  • python-version is set to 3.8
  • the sphinx plugin is only executed with 3.12
  • the sphinx open source code contains syntax for py 3.9 only => error

Version Info

Refurb: v2.0.0
Mypy: v1.10.0

Python Version

3.12.0

Config File

# N/A

Extra Info

None

kasium avatar Oct 11 '24 06:10 kasium