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-133447: Add basic color to `sqlite3` CLI by StanFromIreland · Pull Request #133461 · python/cpython

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented May 5, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

image

request: @hugovk

  • Issue: Colorize sqlite3 CLI #133447

Sorry, something went wrong.

Uh oh!

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

edgarrmondragon reacted with heart emoji ambv reacted with rocket emoji
All reactions
  • ❤️ 1 reaction
  • 🚀 1 reaction
@StanFromIreland
Add
0a33388
@StanFromIreland
StanFromIreland requested review from berkerpeksag and erlend-aasland as code owners May 5, 2025 17:55
@bedevere-app bedevere-app Bot mentioned this pull request May 5, 2025
Colorize sqlite3 CLI #133447
Closed
@bedevere-app bedevere-app Bot added the awaiting review label May 5, 2025
StanFromIreland and others added 2 commits May 5, 2025 18:56
@StanFromIreland
Import cleanup
e680c35
@StanFromIreland
Merge branch 'main' into color_step1
9bf179c
sharktide
sharktide approved these changes May 5, 2025
View reviewed changes

@sharktide sharktide left a comment

Copy link
Copy Markdown
Contributor

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.

Seems good to me

Sorry, something went wrong.

Uh oh!

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

All reactions
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels May 5, 2025
@StanFromIreland
Highlight error messages
b456133
@tomasr8

tomasr8 commented May 6, 2025

Copy link
Copy Markdown
Member

Now that #133347 has been merged, we could take advantage of it in the sqlite CLI as well?

StanFromIreland 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.

StanFromIreland and others added 3 commits May 6, 2025 16:54
@StanFromIreland
Merge branch 'main' into color_step1
8ef9217
@StanFromIreland
Now with themes!
ca015a1
@StanFromIreland
Simpler usage
2c06076
@StanFromIreland

StanFromIreland commented May 6, 2025

Copy link
Copy Markdown
Member Author

cc @ambv Just to check -- did I use themes correctly or did I do something wrong (there is no docs at the moment to verify)?

All reactions

Sorry, something went wrong.

Uh oh!

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

@StanFromIreland
Fixup
198399e
ambv
ambv reviewed May 6, 2025
View reviewed changes

@ambv ambv left a comment

Copy link
Copy Markdown
Contributor

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.

Yeah, there are no docs so I'll push here with how I'd do it if that's okay.

Sorry, something went wrong.

Uh oh!

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

StanFromIreland reacted with heart emoji
All reactions
  • ❤️ 1 reaction
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

@StanFromIreland
StanFromIreland requested a review from ambv May 6, 2025 18:27
@ambv
Simplify
2a8c729
@ambv
ambv force-pushed the color_step1 branch from 158c50c to 2a8c729 Compare May 6, 2025 18:37
ambv
ambv reviewed May 6, 2025
View reviewed changes

@ambv ambv left a comment

Copy link
Copy Markdown
Contributor

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.

Let me know what you think.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

Comment thread Lib/test/test_sqlite3/test_cli.py Resolved

Uh oh!

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

@ambv
Don't skip coloring errors on single-statement execution
a220442
ambv
ambv reviewed May 6, 2025
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

ambv
ambv reviewed May 6, 2025
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

ambv and others added 2 commits May 6, 2025 21:00
@ambv
Also ignore color in the CLI test case
e65d724
@StanFromIreland
Clean up
66711a0
@StanFromIreland

StanFromIreland commented May 6, 2025

Copy link
Copy Markdown
Member Author

Looks good to me now, thank you for the assistance:-)

If you need help with colorise I’d be happy to lend a hand.

ambv 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.

@ambv

ambv commented May 6, 2025

Copy link
Copy Markdown
Contributor

Excellent! Since all this is already for 3.15, I think we might attempt a SQL syntax highlighter as well, although I'm not entirely sure our tokenizer will take kindly to it, so this might become a larger task. We have plenty of time, though.

StanFromIreland and erlend-aasland 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.

ambv
ambv approved these changes May 6, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels May 6, 2025
@erlend-aasland erlend-aasland changed the title gh-133447: Add basic color to sqlite3 cli gh-133447: Add basic color to sqlite3 CLI May 7, 2025
erlend-aasland
erlend-aasland reviewed May 7, 2025
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

@StanFromIreland @erlend-aasland
Fix line removal
62a0164
Co-authored-by: Erlend E. Aasland <[email protected]>
@StanFromIreland
StanFromIreland requested a review from erlend-aasland May 7, 2025 19:27
erlend-aasland
erlend-aasland approved these changes May 7, 2025
View reviewed changes
@erlend-aasland

erlend-aasland commented May 7, 2025

Copy link
Copy Markdown
Contributor

Excellent! Since all this is already for 3.15, I think we might attempt a SQL syntax highlighter as well, although I'm not entirely sure our tokenizer will take kindly to it, so this might become a larger task. We have plenty of time, though.

SQL highlighting would be awesome.

All reactions

Sorry, something went wrong.

Uh oh!

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

@StanFromIreland

StanFromIreland commented May 7, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

All the test fails are unrelated.

SQL highlighting would be awesome.

Working on it :-)

erlend-aasland reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

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

@StanFromIreland
Merge branch 'main' into color_step1
52ee84c
StanFromIreland
StanFromIreland commented May 9, 2025
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

@StanFromIreland
Lint
4ed5815
@erlend-aasland

erlend-aasland commented May 10, 2025

Copy link
Copy Markdown
Contributor

@StanFromIreland, please look into the failing tests.

All reactions

Sorry, something went wrong.

Uh oh!

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

@StanFromIreland

StanFromIreland commented May 10, 2025

Copy link
Copy Markdown
Member Author

I was testing the broken behavior that was now fixed, oops!

All reactions

Sorry, something went wrong.

Uh oh!

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

@StanFromIreland
fixup! Lint
4c0b52c
@StanFromIreland

StanFromIreland commented May 10, 2025

Copy link
Copy Markdown
Member Author

@erlend-aasland Test has been corrected to work with the new updates.

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 enabled auto-merge (squash) May 10, 2025 07:35
@erlend-aasland
erlend-aasland merged commit 30b1d8f into python:main May 10, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label May 10, 2025
@StanFromIreland
StanFromIreland deleted the color_step1 branch May 10, 2025 07:59
@bedevere-bot

bedevere-bot commented May 10, 2025

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot ARM64 Windows 3.x (tier-3) has failed when building commit 30b1d8f.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/729/builds/8781) and take a look at the build logs.
  4. Check if the failure is related to this commit (30b1d8f) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/729/builds/8781

Failed tests:

  • test_zipfile

Failed subtests:

  • test_write_without_source_date_epoch - test.test_zipfile.test_core.OtherTests.test_write_without_source_date_epoch

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "C:\Workspace\buildarea\3.x.linaro-win-arm64\build\Lib\test\test_zipfile\test_core.py", line 1832, in test_write_without_source_date_epoch
    self.assertAlmostEqual(z_time, c_time, delta=1)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 28 != 30 within 1 delta (2 difference)


Traceback (most recent call last):
  File "C:\Workspace\buildarea\3.x.linaro-win-arm64\build\Lib\test\test_zipfile\test_core.py", line 1832, in test_write_without_source_date_epoch
    self.assertAlmostEqual(z_time, c_time, delta=1)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 36 != 38 within 1 delta (2 difference)
All reactions

Sorry, something went wrong.

Uh oh!

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

@StanFromIreland

StanFromIreland commented May 10, 2025

Copy link
Copy Markdown
Member Author

Unrelated.

All reactions

Sorry, something went wrong.

Uh oh!

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

hugovk
hugovk reviewed May 10, 2025
View reviewed changes
Comment thread Lib/sqlite3/__main__.py Resolved

Uh oh!

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

tanloong pushed a commit to tanloong/cpython that referenced this pull request May 10, 2025
@StanFromIreland @tanloong
cherry pick from and resolve conflicts with 30b1d8f on main branch
833140c
(pythongh-133447: Add basic color to `sqlite3` CLI (python#133461))
@tanloong tanloong mentioned this pull request Jun 14, 2025
sqlite3 CLI does not recognize dot commands with trailing spaces #133439
Closed
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@StanFromIreland @Pranjal095
pythongh-133447: Add basic color to sqlite3 CLI (python#133461)
135a100
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@StanFromIreland @taegyunkim
pythongh-133447: Add basic color to sqlite3 CLI (python#133461)
746a1c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk left review comments
@erlend-aasland erlend-aasland erlend-aasland approved these changes
@ambv ambv ambv approved these changes
@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag
+1 more reviewer
@sharktide sharktide sharktide approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

No one assigned

Labels

None yet

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.

7 participants

@StanFromIreland @tomasr8 @ambv @erlend-aasland @bedevere-bot @hugovk @sharktide
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.