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 support for Python 3.12 #143

Merged
merged 6 commits into from
Oct 9, 2023
Merged

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!

pyproject.toml Show resolved Hide resolved
@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
22 checks passed
@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