GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Thoroughly refactor the cases generator by gvanrossum · Pull Request #107151 · python/cpython

Conversation

@gvanrossum

@gvanrossum gvanrossum commented Jul 23, 2023

Copy link
Copy Markdown
Member

This mostly extracts a whole bunch of stuff out of generate_cases.py into separate files, but there are a few other things going on here.

  • analysis.py: Analyzer etc.
  • instructions.py: Instruction etc.
  • flags.py: InstructionFlags, variable_used, variable_used_unspecialized
  • formatting.py: Formatter etc.
  • Rename parser.py to parsing.py, to avoid conflict with stdlib parser.py
  • Blackify most things
  • Fix most mypy errors
  • Remove output filenames from Generator state
  • Fix unit tests

The review request is mostly a heads up: if you have pending PRs that affect Tools/cases_generator/, they probably will become a major merge conflict. I can wait for those (making the conflicts my problem) but I need to know about them. Of course if you want to review the changes carefully, be my guest.

(Why do this now? I have more changes coming up related to macros with array stack effects, but I'd like to get this out of the way first, so I don't mix refactoring and functionality changes.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
gvanrossum added 7 commits July 23, 2023 12:51
@gvanrossum
Extract Formatter etc. into formatting.py; mv pars{er,ing}.py
361dd47
@gvanrossum
Extract InstructionFlags etc. into flags.py
4bc2c5c
@gvanrossum
Extract Instruction etc. into instructions.py
1710508
@gvanrossum
Extract Analyzer (but not Generator) into analysis.py
4bf48d4
@gvanrossum
Blackify what's left of generate_cases.py
095d37f
@gvanrossum
Remove output filenames from Generator state
2376916
@gvanrossum
Fix test_generated_cases.py
258bb41
@gvanrossum gvanrossum added skip issue skip news labels Jul 23, 2023
@gvanrossum
gvanrossum requested review from Fidget-Spinner, brandtbucher and iritkatriel July 23, 2023 20:12
@bedevere-bot bedevere-bot added the awaiting core review label Jul 23, 2023
iritkatriel
iritkatriel approved these changes Jul 23, 2023
View reviewed changes

@iritkatriel iritkatriel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Much better.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Jul 23, 2023
@gvanrossum
gvanrossum merged commit 032f480 into python:main Jul 24, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Jul 24, 2023
@gvanrossum
gvanrossum deleted the refactor-generator branch July 24, 2023 16:38
carljm added a commit to carljm/cpython that referenced this pull request Jul 24, 2023
@carljm
Merge branch 'main' into superfix
9a6bdfa
* main: (73 commits)
  Thoroughly refactor the cases generator (python#107151)
  Docs: Add missing markup to Argument Clinic docs (python#106876)
  pythongh-107162: Document errcode.h usage in its comment (python#107177)
  pythongh-106320: Remove private _PyDict C API (python#107145)
  Fix PyVectorcall_Function doc versionadded (python#107140)
  Docs: Remove duplicate word in Argument Clinic howto heading (python#107169)
  pythongh-107017: Change Chapter Strings to Texts in the Introduction chapter. (python#107104)
  pythongh-106320: Remove private _PyObject C API (python#107159)
  Docs: fix typo in os.pwrite docstring (python#107087)
  pythongh-105291: Add link to migration guide for distutils (python#107130)
  pythongh-106948: Docs: Disable links for C standard library functions, OS utility functions and system calls (python#107062)
  pythongh-106320: Remove _PyBytes_Join() C API (python#107144)
  pythongh-106320: Remove private _PyObject C API (python#107147)
  pythongh-106320: Remove _PyTuple_MaybeUntrack() C API (python#107143)
  pythongh-106320: Remove _PyIsSelectable_fd() C API (python#107142)
  Remove superflous whitespaces in `layout.html`. (pythonGH-107067)
  pythongh-107122: Update what's news for dbm.*dbm.clear() method (pythongh-107135)
  pythongh-107122: Add clear method to dbm.ndbm module (pythongh-107126)
  pythongh-62519: Make pgettext search plurals when translation is not found (python#107118)
  pythongh-107122: Add clear method to dbm.gdbm.module (pythongh-107127)
  ...
jtcave pushed a commit to jtcave/cpython that referenced this pull request Jul 27, 2023
@gvanrossum @jtcave
Thoroughly refactor the cases generator (python#107151)
0572fcc
This mostly extracts a whole bunch of stuff out of generate_cases.py into separate files, but there are a few other things going on here.

- analysis.py: `Analyzer` etc.
- instructions.py: `Instruction` etc.
- flags.py: `InstructionFlags`, `variable_used`, `variable_used_unspecialized`
- formatting.py: `Formatter` etc.
- Rename parser.py to parsing.py, to avoid conflict with stdlib parser.py
- Blackify most things
- Fix most mypy errors
- Remove output filenames from Generator state, add them to `write_instructions()` etc.
- Fix unit tests
@gvanrossum gvanrossum mentioned this pull request Aug 10, 2023
Update README for the cases generator #107826
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@iritkatriel iritkatriel iritkatriel approved these changes
@Fidget-Spinner Fidget-Spinner Awaiting requested review from Fidget-Spinner
@brandtbucher brandtbucher Awaiting requested review from brandtbucher

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@gvanrossum @iritkatriel @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.