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

gh-116000: Make Tools/cases_generator/optimizer_generator.py work without any arguments #116470

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

Eclips4
Copy link
Member

@Eclips4 Eclips4 commented Mar 7, 2024

@@ -27,7 +27,7 @@
from stack import Stack, SizeMismatch, UNUSED

DEFAULT_OUTPUT = ROOT / "Python/optimizer_cases.c.h"
DEFAULT_ABSTRACT_INPUT = ROOT / "Python/optimizer_bytecodes.c"
DEFAULT_ABSTRACT_INPUT = (ROOT / "Python/optimizer_bytecodes.c").absolute().as_posix()
Copy link
Member Author

Choose a reason for hiding this comment

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

This change is needed because of parser/prettify_filename which works only with an str type.

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

Thanks! Though honestly, I wish we weren't using pathlib at all here -- it's been nothing but trouble.

@gvanrossum gvanrossum enabled auto-merge (squash) March 7, 2024 18:41
@Eclips4
Copy link
Member Author

Eclips4 commented Mar 7, 2024

Some kind of proof that this PR works:

Run without arguments:

eclips4@HOME-PC:~/CLionProjects/cpython/Tools/cases_generator$ python3.11 optimizer_generator.py 
eclips4@HOME-PC:~/CLionProjects/cpython/Tools/cases_generator$ 

Run with explicit arguments:

eclips4@HOME-PC:~/CLionProjects/cpython/Tools/cases_generator$ python3.11 optimizer_generator.py ../../Python/optimizer_bytecodes.c ../../Python/bytecodes.c
eclips4@HOME-PC:~/CLionProjects/cpython/Tools/cases_generator$ 

@gvanrossum
Copy link
Member

Would be even more convincing if after the default run git diff showed no changes. But I turned on auto-merge.

@Eclips4
Copy link
Member Author

Eclips4 commented Mar 7, 2024

Would be even more convincing if after the default r

Sure!

Run without args:

eclips4@HOME-PC:~/CLionProjects/cpython$ python3.11 Tools/cases_generator/optimizer_generator.py 
eclips4@HOME-PC:~/CLionProjects/cpython$ git diff
eclips4@HOME-PC:~/CLionProjects/cpython$

Run with args:

eclips4@HOME-PC:~/CLionProjects/cpython$ python3.11 Tools/cases_generator/optimizer_generator.py Python/optimizer_bytecodes.c Pyth
on/bytecodes.c 
eclips4@HOME-PC:~/CLionProjects/cpython$ git diff
eclips4@HOME-PC:~/CLionProjects/cpython$

@gvanrossum gvanrossum merged commit b2d74cd into python:main Mar 7, 2024
40 checks passed
@Eclips4 Eclips4 deleted the issue-116000 branch March 7, 2024 19:08
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants