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

Ensure pypi-normalized names when fetching from npe2api #1335

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aganders3
Copy link
Contributor

Description

This coerces npe2api names to be PyPI-normalized. Thanks to @manasaV3 for debugging the issue and @neuromusic for the link to the normalization docs.

We may want to also fix this in npe2api, but I'm not sure the consequences of changing that right now.

Closes #1334

@aganders3 aganders3 requested a review from manasaV3 January 14, 2025 02:20
@aganders3 aganders3 added the bug-fix Release Label: Used for categorizing bug fixes in automated CI release notes label Jan 14, 2025
pypi_plugin_version = pypi_latest_plugins.get(name)
if pypi_plugin_version == version:
continue

if pypi_plugin_version is None and is_plugin_active(name, version):
Copy link
Collaborator

Choose a reason for hiding this comment

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

As we are fetching data from npe2api and not pypi, could we simply remove the check for is_plugin_active?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think we can remove it. Do you mean in addition to the other changes here, or instead?

I still think it makes sense to do the PyPI normalization to ensure a single version of each plugin. In prod I think this also gives continuity with past versions (though I'm not sure this really matters).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this check in bcbdd73. The check is then unused so I removed the code and tests with it. I'm happy to do whatever is cleanest here 😅.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If we removed the is_plugin_active check, it should also take care of removing the duplicate entry. So one of those checks should be enough.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree the normalization of the names would be nice to have. But if we go down that route, we should also normalize the names in results returned by npe2api, as all of them were not normalized. ex: AlveolEye, acquifer-napari.

@aganders3
Copy link
Contributor Author

I'm not sure why the Push Remote Dev workflow is failing. It looks okay to me in Terraform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fix Release Label: Used for categorizing bug fixes in automated CI release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate plugin entries
2 participants