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

Normalize PyPI package names #578

Merged
merged 13 commits into from
Aug 12, 2022

Conversation

andrewpollock
Copy link
Contributor

@andrewpollock andrewpollock commented Aug 5, 2022

Fixes: #508

Use the same name as the subsequent set comprehensions so it's clearer
to the reader that the same data is being operated on multiple times.
Copy link
Collaborator

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

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

nice! some comments.

Please also update the test here:

def test_update_pypi(self):

to make the test data have an un-normalized name.

* Standardize quoting
* Abstract ecosystem-specific logic into normalization function

See google#578 for details
Copy link
Collaborator

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

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

Nice! Looking good. We just need that test now :)

andrewpollock and others added 7 commits August 9, 2022 11:30
* 19b7d5f introduced a defect, correct
* 47438b7 was passing the wrong object
This will allow for the normalized value to be stored in Datastore and
also set in the pubsub message.
This way the package name gets normalized before it goes to Datastore
and PubSub
@andrewpollock
Copy link
Contributor Author

By George, I do believe I have tests. PTAL

@oliverchang
Copy link
Collaborator

Very nice! I think you just need to format your code per https://github.com/google/osv.dev/runs/7782343232?check_suite_focus=true.

(Ignore the lint errors -- this wasn't blocking our check and we need to fix them per #521)

@andrewpollock
Copy link
Contributor Author

My bad, I knew I'd introduced changes that needed that and forgot to run it. PTAL.

Copy link
Collaborator

@oliverchang oliverchang left a comment

Choose a reason for hiding this comment

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

very nice!! LGTM

@andrewpollock andrewpollock merged commit 989c3a8 into google:master Aug 12, 2022
@andrewpollock andrewpollock deleted the apollock/normalize_pypi branch August 12, 2022 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Normalize PyPI packages from sources.
2 participants