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

Bump flake8-pyi from 22.11.0 to 23.10.0 #891

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Oct 13, 2023

Bumps flake8-pyi from 22.11.0 to 23.10.0.

Release notes

Sourced from flake8-pyi's releases.

23.10.0

  • Introduce Y090, which warns if you have an annotation such as tuple[int] or Tuple[int]. These mean "a tuple of length 1, in which the sole element is of type int". This is sometimes what you want, but more usually you'll want tuple[int, ...], which means "a tuple of arbitrary (possibly 0) length, in which all elements are of type int".

    This error code is disabled by default due to the risk of false-positive errors. To enable it, use the --extend-select=Y090 option.

  • Y011 now ignores sentinel and _typeshed.sentinel in default values.

23.6.0

Features:

  • Support Python 3.12
  • Support PEP 695 syntax for declaring type aliases
  • Correctly emit Y019 errors for PEP-695 methods that are generic around a TypeVar instead of returning typing_extensions.Self
  • Introduce Y057: Do not use typing.ByteString or collections.abc.ByteString. These types have unclear semantics, and are deprecated; use typing_extensions.Buffer or a union such as bytes | bytearray | memoryview instead. See PEP 688 for more details.
  • The way in which flake8-pyi modifies pyflakes runs has been improved:
    • When flake8-pyi is installed, pyflakes will now complain about forward references in default values for function and method parameters (the same as pyflakes does when it checks .py files). Unlike in .py files, forward references in default values are legal in stub files. However, they are never necessary, and are considered bad style. (Forward references for parameter annotations are still allowed.)

      Contributed by tomasr8.

    • When flake8-pyi is installed, pyflakes's F822 check now produces many fewer false positives when flake8 is run on .pyi files. It now understands that x: int in a stub file is sufficient for x to be considered "bound", and that "x" can therefore be included in __all__.

Bugfixes:

  • Y018, Y046, Y047 and Y049 previously failed to detect unused TypeVars/ParamSpecs/TypeAliases/TypedDicts/Protocols if the object in question had multiple definitions in the same file (e.g. across two branches of an if sys.version_info >= (3, 10) check). This bug has now been fixed.
  • Y020 was previously not emitted if quoted annotations were used in TypeVar constraints. This bug has now been fixed.

Other changes:

  • flake8-pyi no longer supports being run on Python 3.7, which has reached its end of life.
  • flake8-pyi no longer supports being run with flake8 <v6.

23.5.0

  • flake8-pyi no longer supports being run with flake8 <5.0.4.
  • The way in which flake8-pyi modifies pyflakes runs has been improved:
    • When flake8-pyi is installed, pyflakes now correctly recognises an annotation as being equivalent to a binding assignment in a stub file, reducing false positives from flake8's F821 error code.

    • When flake8-pyi is installed, there are now fewer pyflakes positives from class definitions that have forward references in the bases tuple for the purpose of creating recursive or circular type definitions. These are invalid in .py files, but are supported in stub files.

    • When flake8-pyi is installed, pyflakes will also complain about code which (in combination with flake8-pyi) it previously had no issue with. For example, it will now complain about this code:

      class Foo(Bar): ...
      class Bar: ...

      Although the above code is legal in a stub file, it is considered poor style, and the forward reference serves no purpose (there is no recursive or circular definition). As such, it is now disallowed by pyflakes when flake8-pyi is installed.

... (truncated)

Changelog

Sourced from flake8-pyi's changelog.

23.10.0

  • Introduce Y090, which warns if you have an annotation such as tuple[int] or Tuple[int]. These mean "a tuple of length 1, in which the sole element is of type int". This is sometimes what you want, but more usually you'll want tuple[int, ...], which means "a tuple of arbitrary (possibly 0) length, in which all elements are of type int".

    This error code is disabled by default due to the risk of false-positive errors. To enable it, use the --extend-select=Y090 option.

  • Y011 now ignores sentinel and _typeshed.sentinel in default values.

23.6.0

Features:

  • Support Python 3.12
  • Support PEP 695 syntax for declaring type aliases
  • Correctly emit Y019 errors for PEP-695 methods that are generic around a TypeVar instead of returning typing_extensions.Self
  • Introduce Y057: Do not use typing.ByteString or collections.abc.ByteString. These types have unclear semantics, and are deprecated; use typing_extensions.Buffer or a union such as bytes | bytearray | memoryview instead. See PEP 688 for more details.
  • The way in which flake8-pyi modifies pyflakes runs has been improved:
    • When flake8-pyi is installed, pyflakes will now complain about forward references in default values for function and method parameters (the same as pyflakes does when it checks .py files). Unlike in .py files, forward references in default values are legal in stub files. However, they are never necessary, and are considered bad style. (Forward references for parameter annotations are still allowed.)

      Contributed by tomasr8.

    • When flake8-pyi is installed, pyflakes's F822 check now produces many fewer false positives when flake8 is run on .pyi files. It now understands that x: int in a stub file is sufficient for x to be considered "bound", and that "x" can therefore be included in __all__.

Bugfixes:

  • Y018, Y046, Y047 and Y049 previously failed to detect unused TypeVars/ParamSpecs/TypeAliases/TypedDicts/Protocols if the object in question had multiple definitions in the same file (e.g. across two branches of an if sys.version_info >= (3, 10) check). This bug has now been fixed.
  • Y020 was previously not emitted if quoted annotations were used in TypeVar constraints. This bug has now been fixed.

Other changes:

  • flake8-pyi no longer supports being run on Python 3.7, which has reached its end of life.
  • flake8-pyi no longer supports being run with flake8 <v6.

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [flake8-pyi](https://github.com/PyCQA/flake8-pyi) from 22.11.0 to 23.10.0.
- [Release notes](https://github.com/PyCQA/flake8-pyi/releases)
- [Changelog](https://github.com/PyCQA/flake8-pyi/blob/main/CHANGELOG.md)
- [Commits](PyCQA/flake8-pyi@22.11.0...23.10.0)

---
updated-dependencies:
- dependency-name: flake8-pyi
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot requested a review from asvetlov as a code owner October 13, 2023 23:18
@dependabot dependabot bot added autosquash dependencies Pull requests that update a dependency file labels Oct 13, 2023
@github-actions github-actions bot enabled auto-merge (squash) October 13, 2023 23:18
Copy link
Contributor Author

dependabot bot commented on behalf of github Nov 8, 2023

Superseded by #896.

@dependabot dependabot bot closed this Nov 8, 2023
auto-merge was automatically disabled November 8, 2023 23:22

Pull request was closed

@dependabot dependabot bot deleted the dependabot/pip/flake8-pyi-23.10.0 branch November 8, 2023 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosquash dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants