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

Add upper limit to pyflake's version <3.0 to support handling of python 2.x # type: comments #186

Merged
merged 1 commit into from
Nov 24, 2022

Conversation

psasselum
Copy link
Contributor

The latest pyflake version removed handling of python 2.x # type: comments. As the dependency was not upper limited in release of autoflake, none of the available release of autoflake handle's 2.X style typing. It would be very convenient to have a last release that support it in autoflake before allowing pyflake > 3.0 again.

The latest pyflake version removed handling of python 2.x ``# type:`` comments.
It would be very convenient to have a last release that support it in autoflake. 

As the dependency was not upper limited none of the current release of autoflake handle's 2.X style typing.
@psasselum psasselum changed the title Add upper limit to pyflake's version <3.0 Add upper limit to pyflake's version <3.0 to support handling of python 2.x # type: comments Nov 24, 2022
@Pierre-Sassoulas
Copy link
Member

It seem that the supported version is 3.7 so something like this, which would have worked without a major release if python 3.5 was still supported would not make a lot of sense:

    "pyflakes>=1.1.0,<3;python_version<'3.6'",
    "pyflakes>=1.1.0,<4;python_version>='3.6'",

Beside 2.x style typing can still be used in python version > 3.5. I think releasing a major with pyflakes>=1.1.0,<4 immediately after the next release make sense. That way there's a last release for 2.x typing and the major can announce the breaking change.

@bityob
Copy link

bityob commented Nov 24, 2022

For those who use pre-commit with autoflake,
you can pin the pyflakes dependency like this:

  - repo: https://github.com/PyCQA/autoflake.git
    rev: v1.4
    hooks:
      - id: autoflake
        args:
          - --in-place
          - --remove-unused-variables
          - --remove-all-unused-imports
          - --ignore-init-module-imports
          - --remove-duplicate-keys
        language_version: python3
        additional_dependencies:
          - pyflakes>=1.1.0,<3

@fsouza fsouza merged commit 0152be5 into PyCQA:main Nov 24, 2022
@psasselum psasselum deleted the patch-1 branch November 24, 2022 14:34
@psasselum
Copy link
Contributor Author

Thank you for the quick release 👌

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

Successfully merging this pull request may close these issues.

4 participants