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

Add a UI to check if a project name is allowed #11408

Closed
pfmoore opened this issue May 18, 2022 · 6 comments
Closed

Add a UI to check if a project name is allowed #11408

pfmoore opened this issue May 18, 2022 · 6 comments

Comments

@pfmoore
Copy link
Contributor

pfmoore commented May 18, 2022

What's the problem this feature will solve?
At the moment, the only way to register a project is to upload it. That's fine, but you need to choose a project name, and there is no way to know in advance if PyPI will reject that project name when you upload it.

Describe the solution you'd like
A UI and/or API that allows users to enter a project name and get a response saying whether it will be allowed, or if not, why not (the same sort of output as you get when trying to upload a new project).

Additional context
See https://discuss.python.org/t/how-can-i-request-a-package-to-be-added/15834 for a case where this occurred.

It is, of course, possible to create and upload an empty package, just to reserve the name. But do we really want to encourage people to upload junk packages? It's too easy (at least, it is if you're me!) to start a project, and get distracted and never actually get it to a releasable state.

One downside is that just because a name was allowable one day, doesn't mean it will still be allowable a week later when the project is ready for upload. We could implement some sort of "reservation" of names for a short period, but I believe this is overkill, and the simpler approach of just allowing people to check (maybe giving a warning saying that the check doesn't guarantee that the name will remain available) is perfectly adequate for the majority of cases.

@di
Copy link
Member

di commented May 18, 2022

Thanks for the issue. I think this is a duplicate of #2082 but I'll let you decide.

@pfmoore
Copy link
Contributor Author

pfmoore commented May 18, 2022

Reserving names would make this feature unnecessary, but I would find this useful while reserving names is not possible. I don't know what the likely timescale on a name reservation feature is, or whether this is simple enough to be worth considering as a short-term approach.

One thing that is particularly annoying, though, is that it's currently not possible to be sure you're not going to trigger the "too similar to another package" check. Is the algorithm used to check similarity documented anywhere? If it is, then it would be possible to write a tool that did the check independently, and that would solve the short term problem without a warehouse change.

@miketheman
Copy link
Member

Is the algorithm used to check similarity documented anywhere?

The name collision algorithm is currently a Postgres function that is run as a step of a package upload.

@pfmoore
Copy link
Contributor Author

pfmoore commented May 19, 2022

OK. If I were to lift that and make a Python package that checked if a name was allowed, what's the chances you'd change the rules and my code would need modifying? (To be clear, I don't care much for personal use, but if I publish it, I don't want to make claims of accuracy that I can't maintain).

@di
Copy link
Member

di commented May 19, 2022

I'm not sure it really would make sense to externalize? To use a recent example, if you wanted to (externally) determine why lichess.py was prohibited, you'd have to check for the presence of a lot of possible project names: lichesspy, l1chesspy l-ichesspy, li-chesspy, ...etc. Most often it's going to be fairly close, but it might not be.

To answer your question though: this is something that we're probably going to want to continue to tweak, and I wouldn't consider it set in stone. So there's a good chance it an external version wouldn't remain accurate in the future.

@pfmoore
Copy link
Contributor Author

pfmoore commented May 19, 2022

OK, so a personal script that takes the simple index, ultranormalizes everything, and to check a name ultranormalizes it and reports "OK" or "Clashes with [list of stuff that normalizes the same]" seems like the best idea for now. If others want to do something similar, they can find this issue and either upvote it if they want something "official", or make their own script along the lines I described here.

That sounds reasonable to me. Feel free to close this issue if you want. Thanks for the help.

@di di closed this as completed Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants