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-88597: Added command line interface to UUID module. by achhina · Pull Request #99463 · python/cpython

Conversation

@achhina

@achhina achhina commented Nov 14, 2022 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

UUID module now supports command line usage.

❯ ./python.exe -m uuid             
5f2d57b1-90e8-417c-ba5d-69b9b6f74289

❯ ./python.exe -m uuid -h          
usage: uuid.py [-h] [-u {uuid1,uuid3,uuid4,uuid5}] [-ns NAMESPACE] [-n NAME]

Generates a uuid using the selected uuid function.

options:
  -h, --help            show this help message and exit
  -u {uuid1,uuid3,uuid4,uuid5}, --uuid {uuid1,uuid3,uuid4,uuid5}
                        The function to use to generate the uuid. By default uuid4 function is used.
  -ns NAMESPACE, --namespace NAMESPACE
                        The namespace used as part of generating the uuid. Only required for uuid3/uuid5 functions.
  -n NAME, --name NAME  The name used as part of generating the uuid. Only required for uuid3/uuid5 functions.
  • Tests ran locally
  • Issue: Add command-line functionality to uuid module #88597

Sorry, something went wrong.

Uh oh!

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

arhadthedev reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@bedevere-bot bedevere-bot added the awaiting review label Nov 14, 2022
@bedevere-bot bedevere-bot mentioned this pull request Nov 14, 2022
Add command-line functionality to uuid module #88597
Closed
@achhina

achhina commented Nov 14, 2022

Copy link
Copy Markdown
Contributor Author

Hi @nanjekyejoannah, as you reviewed the first PR for this issue, would you be able to take a look at this one when you get a chance? I ended up moving the CLI logic to a separate function and importing & using argparse only in there to keep the rest of the module lightweight.

All reactions

Sorry, something went wrong.

Uh oh!

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

arhadthedev
arhadthedev reviewed Nov 14, 2022
View reviewed changes
Comment thread Lib/uuid.py Resolved

Uh oh!

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

@achhina
achhina force-pushed the GH-88597 branch 3 times, most recently from 81c6b06 to 99df7ef Compare November 14, 2022 09:23
sobolevn
sobolevn reviewed Nov 14, 2022
View reviewed changes

@sobolevn sobolevn 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.

Thank you!

I know that not all CLI entrypoints are tested, but I think we should start doing it. Especially because you have logic in your main, not just some other function call.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/uuid.rst Resolved

Uh oh!

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

Comment thread Doc/library/uuid.rst Resolved

Uh oh!

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

Comment thread Doc/library/uuid.rst Resolved

Uh oh!

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

Comment thread Doc/library/uuid.rst Resolved

Uh oh!

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

Comment thread Doc/library/uuid.rst Resolved

Uh oh!

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

Comment thread Lib/uuid.py Resolved

Uh oh!

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

@achhina
achhina force-pushed the GH-88597 branch 2 times, most recently from 31edacd to cc423c8 Compare November 15, 2022 02:50
@achhina achhina closed this Nov 15, 2022
@achhina
achhina force-pushed the GH-88597 branch from cc423c8 to 57be545 Compare November 15, 2022 04:06
@achhina achhina reopened this Nov 15, 2022
@achhina
achhina force-pushed the GH-88597 branch 2 times, most recently from a0416f1 to e7fa43b Compare November 15, 2022 07:20
@achhina

achhina commented Nov 15, 2022

Copy link
Copy Markdown
Contributor Author

Hi @sobolevn, thanks for taking a look! I believe I've addressed all the comments, and have added in some unit tests. Would you be able to take a look again when you have time?

All reactions

Sorry, something went wrong.

Uh oh!

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

sobolevn
sobolevn reviewed Nov 15, 2022
View reviewed changes

@sobolevn sobolevn 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.

Thanks! Several more ideas / comments :)

I think this can also be added to whatsnew/3.12, because this feature is quite useful.

Sorry, something went wrong.

Uh oh!

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

achhina reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Doc/library/uuid.rst Resolved

Uh oh!

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

Comment thread Doc/library/uuid.rst Resolved

Uh oh!

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

Comment thread Lib/test/test_uuid.py Resolved

Uh oh!

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

Comment thread Lib/uuid.py Resolved

Uh oh!

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

@achhina
pythonGH-88597: Added command line interface to UUID module.
6d38439
@achhina
achhina force-pushed the GH-88597 branch from e7fa43b to 6d38439 Compare November 16, 2022 03:36
@achhina

achhina commented Nov 16, 2022

Copy link
Copy Markdown
Contributor Author

Hi @sobolevn! I've tried to address all the comments you provided, would you be able to take another look?

All reactions

Sorry, something went wrong.

Uh oh!

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

sobolevn
sobolevn approved these changes Nov 16, 2022
View reviewed changes

@sobolevn sobolevn 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.

LGTM! But, this will require a core-dev acceptance as well.

Sorry, something went wrong.

Uh oh!

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

achhina and gpshead reacted with thumbs up emoji
All reactions
  • 👍 2 reactions
@bedevere-bot bedevere-bot added awaiting core review and removed awaiting review labels Nov 16, 2022
achhina and others added 2 commits January 21, 2023 20:16
@achhina
Merge branch 'main' into pythonGH-88597
b022141
@gpshead
use ReST in the news entry.
0e8cd97
gpshead
gpshead approved these changes Jan 22, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting core review labels Jan 22, 2023
@gpshead
gpshead merged commit 95f5b05 into python:main Jan 22, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Jan 22, 2023
@gpshead

gpshead commented Jan 22, 2023

Copy link
Copy Markdown
Member

thanks!

achhina reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

@arhadthedev arhadthedev mentioned this pull request Jan 22, 2023
gh-93096: Make mimetypes CLI tool public #93097
Merged
@merwok

merwok commented Jan 22, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

For next PRs to Python repos, please don’t force push, it makes reviews less nice (comments can lose context, github notifs don’t link to a useful page, etc). See https://devguide.python.org/getting-started/pull-request-lifecycle/index.html

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

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

Reviewers

@arhadthedev arhadthedev arhadthedev left review comments
@gpshead gpshead gpshead approved these changes
@sobolevn sobolevn sobolevn approved these changes

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.

6 participants

@achhina @gpshead @merwok @sobolevn @arhadthedev @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.