Skip to content

Conversation

@bkeryan
Copy link
Contributor

@bkeryan bkeryan commented Oct 5, 2023

What does this Pull Request accomplish?

Update version constraints to use flake8 = "^6.1" and pycodestyle = "^2.11" for Python 3.12 and later. The enhanced f-string support in Python 3.12 changed how the ast module parses f-strings, which required updates to pycodestyle.

Fix test failures introduced by the update:

  • flake8 no longer tolerates inline comments in the ignore field. Comments and error numbers must be on separate lines.
  • pycodestyle no longer reports "E721 do not compare types, use 'isinstance()'" for comparisons that use the is operator.
  • pycodestyle no longer reports "E741 ambiguous variable name" when using the variable; it only reports this error when assigning the variable.

Update PR workflow to test with Python 3.12.

Why should this Pull Request be merged?

Fixes #142

What testing has been done?

Ran poetry run pytest -v with both Python 3.9.13 and 3.12.0.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Thank you for contributing! 👋

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Thank you for contributing! 👋

Since this changes the Coding Conventions, I'll @-mention the appropriate NI engineers.
@alejandro5042
@DavidCurtiss
@irwand
@jryckman
@kcuzner
@mshafer-NI
@neilvana
@nethrasuresh
@pakdev
@rtzoeller
@sbethur
@stick152
@tkrebes
@Adithyak1998
@innagarc
@ShibaniRout

Copy link
Collaborator

@mshafer-NI mshafer-NI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!

@mshafer-NI
Copy link
Collaborator

Thank you for contributing! 👋

Since this changes the Coding Conventions, I'll @-mention the appropriate NI engineers. @alejandro5042 @DavidCurtiss @irwand @jryckman @kcuzner @mshafer-NI @neilvana @nethrasuresh @pakdev @rtzoeller @sbethur @stick152 @tkrebes @Adithyak1998 @innagarc @ShibaniRout

The "conventions change" is just updating an example to something will be flagged with changes to pycodestyle. No effective change.

@mshafer-NI mshafer-NI merged commit c61b1f7 into ni:main Oct 9, 2023
@bkeryan bkeryan deleted the users/bkeryan/python-3.12 branch October 9, 2023 22:07
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.

Spurious warnings in f-strings with Python 3.12

3 participants