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

Fix unicode entrypoint issue #254

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

Conversation

julienmalard
Copy link

@julienmalard julienmalard commented Dec 14, 2024

Fixes: #252

Test for valid unicode Python identifiers (https://peps.python.org/pep-3131/) in entrypoints. Should reproduce #252 .

module = match.group("module")
assert isinstance(module, str)
module, attrs = [x.strip() for x in value.split(":", 1)]
assert len(module)
Copy link
Member

Choose a reason for hiding this comment

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

Should also check module is a valid identifier

@julienmalard
Copy link
Author

julienmalard commented Dec 14, 2024

Thanks, done!

I also have a doubt - in the test files, entrypoints are not quoted. However, in a yaml file, the value (attrs) would always be quoted and the key (module) could optionally be quoted as well.
Are the quotes stripped before arriving at the relevant parts of the code?

I also did not understand the extras part of the original regex and so did not reimplement it. Is this fine, or should we add an example of extras the to tests?

@julienmalard julienmalard changed the title Add unicode entrypoint tests Fix unicode entrypoint issue Dec 17, 2024
@julienmalard
Copy link
Author

Fixes #252

@Secrus
Copy link
Member

Secrus commented Dec 29, 2024

I also did not understand the extras part of the original regex and so did not reimplement it. Is this fine, or should we add an example of extras the to tests?

It's a legacy distutils/setuptools thing, that allowed for a conditional installation of the entrypoint based on the chosen extra. It's not a standard anymore, but we should keep it working and the new implementation should consider it a viable (although ignored) part of an entrypoint spec.

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.

Error in unicode entry scripts
3 participants