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

tools/autopep8.sh corrupts Python format strings in Python 3.12 environments #10828

Closed
bneradt opened this issue Nov 19, 2023 · 2 comments
Closed
Labels
Milestone

Comments

@bneradt
Copy link
Contributor

bneradt commented Nov 19, 2023

I noticed this when I switched my dev environment yesterday from fedora:38 to fedora:39. It seems with my fedora:39 environment, the cmake --build build --target autopep8 target changes many (or all?) of the .py file's format. This is obviously terrible as we can't have different dev environments formatting differently between them.

I'm not sure what the issue is yet. The pip freeze is identical between them:

fedora:38:

╰─➤  pip freeze
autopep8==1.5.3
pycodestyle==2.6.0
toml==0.10.2

fedora:39:

╰─➤  pip freeze
autopep8==1.5.3
pycodestyle==2.6.0
toml==0.10.2

I suppose this is likely due with the upgrade from Python 3.11 in fedora:38 to Python 3.12 in fedora:39. I'm not sure yet however.

@bneradt bneradt added the format label Nov 19, 2023
@bneradt bneradt added this to the 10.0.0 milestone Nov 19, 2023
@bneradt
Copy link
Contributor Author

bneradt commented Nov 19, 2023

I think the following autopep8 issue is the cause:

hhatto/autopep8#712

Looking at the diffs generated with Python 3.12 locally, it seems like they do indeed relate to format strings.

@bneradt bneradt changed the title tools/autopep8.sh has changed its format scheme in recent environements tools/autopep8.sh corrupts Python format strings in Python 3.12 environments Nov 19, 2023
@bneradt
Copy link
Contributor Author

bneradt commented Dec 4, 2023

We addressed this issue by moving to yapf from autopep8:
#10860

@bneradt bneradt closed this as completed Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant