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 — gh-104683: Rename clinic.test => clinic.test.c by erlend-aasland · Pull Request #106443 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Jul 5, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor
  • Issue: Modernise code in Tools/clinic/ #104683

Sorry, something went wrong.

Uh oh!

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

All reactions
@erlend-aasland
pythongh-104683: Rename clinic.test => clinic.test.c
c6cedd0
@erlend-aasland
erlend-aasland requested a review from AlexWaygood as a code owner July 5, 2023 08:07
@erlend-aasland erlend-aasland added the skip news label Jul 5, 2023
@bedevere-bot bedevere-bot added the awaiting core review label Jul 5, 2023
@bedevere-bot bedevere-bot mentioned this pull request Jul 5, 2023
Modernise code in Tools/clinic/ #104683
Closed
5 of 7 tasks
AlexWaygood
AlexWaygood approved these changes Jul 5, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Jul 5, 2023
@AlexWaygood

AlexWaygood commented Jul 5, 2023

Copy link
Copy Markdown
Member

Might be worth backporting this; it'll reduce the risk of merge conflicts in future backport PRs

erlend-aasland reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland erlend-aasland added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Jul 5, 2023
@erlend-aasland
erlend-aasland enabled auto-merge (squash) July 5, 2023 08:19
@erlend-aasland
erlend-aasland merged commit a941bd6 into python:main Jul 5, 2023
@miss-islington

miss-islington commented Jul 5, 2023

Copy link
Copy Markdown
Contributor

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the awaiting merge label Jul 5, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 5, 2023
@erlend-aasland @miss-islington
pythongh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (
e83dc5b
pythonGH-106443)

(cherry picked from commit a941bd6)

Co-authored-by: Erlend E. Aasland <[email protected]>
@bedevere-bot

bedevere-bot commented Jul 5, 2023

Copy link
Copy Markdown

GH-106444 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jul 5, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 5, 2023
@erlend-aasland @miss-islington
pythongh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (
aa3a921
pythonGH-106443)

(cherry picked from commit a941bd6)

Co-authored-by: Erlend E. Aasland <[email protected]>
@bedevere-bot

bedevere-bot commented Jul 5, 2023

Copy link
Copy Markdown

GH-106445 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 5, 2023
AlexWaygood pushed a commit that referenced this pull request Jul 5, 2023
@miss-islington @erlend-aasland
[3.12] gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test…
00c522a
….c (GH-106443) (#106444)

gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (GH-106443)
(cherry picked from commit a941bd6)

Co-authored-by: Erlend E. Aasland <[email protected]>
AlexWaygood pushed a commit that referenced this pull request Jul 5, 2023
@miss-islington @erlend-aasland
[3.11] gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test…
edb29f0
….c (GH-106443) (#106445)

gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (GH-106443)
(cherry picked from commit a941bd6)

Co-authored-by: Erlend E. Aasland <[email protected]>
@erlend-aasland
erlend-aasland deleted the clinic/rename-clinic.test branch July 5, 2023 09:16
carljm added a commit to carljm/cpython that referenced this pull request Jul 5, 2023
@carljm
Merge branch 'main' into modulelocals
4c59e51
* main: (39 commits)
  pythongh-102542 Remove unused bytes object and bytes slicing (python#106433)
  Clarify state of CancelledError in doc (python#106453)
  pythongh-64595: Fix regression in file write logic in Argument Clinic (python#106449)
  pythongh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (python#106443)
  tp_flags docs: fix indentation (python#106420)
  pythongh-104050: Partially annotate Argument Clinic CLanguage class (python#106437)
  pythongh-106368: Add tests for formatting helpers in Argument Clinic (python#106415)
  pythongh-104050: Annotate Argument Clinic parameter permutation helpers (python#106431)
  pythongh-104050: Annotate toplevel functions in clinic.py (python#106435)
  pythongh-106320: Fix specialize.c compilation by including pycore_pylifecycle.h (python#106434)
  Add some codeowners for `Tools/clinic/` (python#106430)
  pythongh-106217: Truncate the issue body size of `new-bugs-announce-notifier` (python#106423)
  pythongh-61215: Rename `wait_until_any_call` to `wait_until_any_call_with` (python#106414)
  pythongh-106162: array: suppress warning in test_array (python#106404)
  pythongh-106320: Remove _PyInterpreterState_HasFeature() (python#106425)
  pythonGH-106360: Support very basic superblock introspection (python#106422)
  pythongh-106406: Fix _Py_IsInterpreterFinalizing() in _winapi.c (python#106408)
  pythongh-106396: Special-case empty format spec to gen empty JoinedStr node (python#106401)
  pythongh-106368: Add tests for permutation helpers in Argument Clinic (python#106407)
  pythonGH-106008: Fix refleak when peepholing `None` comparisons (python#106367)
  ...
@serhiy-storchaka

serhiy-storchaka commented Aug 8, 2023

Copy link
Copy Markdown
Member

I intentionally made this file having extension different from .c, so clinic.py --make will not regenerate it.

It makes regenerating it inconvenient, but on other hand, it prevents unintentional regeneration. Otherwise the breaking changes in clinic.py can pass unnoticed, because make clinic is ran before clinic tests.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

There was consensus on the core dev Discord for this change.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

Ideally, I would like to get rid of clinic.test.c, and move all those test to _testclinic.c, to make sure the generated code actually works as expected in Python.

All reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

It makes regenerating it inconvenient, but on other hand, it prevents unintentional regeneration. Otherwise the breaking changes in clinic.py can pass unnoticed, because make clinic is ran before clinic tests.

IMO, a better option is to add an --exclude option to the clinic CLI and explicitly exclude that file when running make clinic.

AlexWaygood and serhiy-storchaka reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

See #107770 for my suggestion to preserve make clinic behaviour.

All reactions

Sorry, something went wrong.

Uh oh!

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

@serhiy-storchaka

serhiy-storchaka commented Aug 8, 2023

Copy link
Copy Markdown
Member

Initially I introduced Lib/test/clinic.test as a temporary solution, because I was not very familiar with the AC code and did not know how to use it programmatically to generate only an interesting part of output (I still does not know this). clinic.test contains a lot of generated noise unrelated to a purpose of specific test. For example all these ugly struct initializers for _kwtuple and _parser take too much space.

My hope is that someday someone (maybe you, maybe me) will turn most or all of these tests into proper unit tests.

erlend-aasland reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

@erlend-aasland

erlend-aasland commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

It sounds to me that your intention harmonises with my desire to turn clinic.test.c into functional tests. So we agree, I think.

serhiy-storchaka reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@AlexWaygood AlexWaygood AlexWaygood approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

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.

5 participants

@erlend-aasland @AlexWaygood @miss-islington @bedevere-bot @serhiy-storchaka
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.