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

maturin init/new should validate the package name #1398

Closed
not-my-profile opened this issue Jan 8, 2023 · 7 comments · Fixed by #2007
Closed

maturin init/new should validate the package name #1398

not-my-profile opened this issue Jan 8, 2023 · 7 comments · Fixed by #2007
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@not-my-profile
Copy link

Package names of Rust libraries and package names of Python libraries both need to fulfill certain criteria. maturin init/new apparently currently doesn't check for any of these criteria e.g. maturin init "foo bar" works fine even though neither Rust nor Python support package names with a space.

I think ideally maturin would check the supplied name against two regexes (one for Rust package names and one for Python package names) and report which check failed in case the supplied name doesn't match.

Note that I think PyPI disallows certain package names like names of modules in the standard library ... it would be nice if maturin could check for these as well but that might not be easily doable (see also pypi/warehouse#8533).

@messense messense added the enhancement New feature or request label Jan 9, 2023
@messense
Copy link
Member

messense commented Jan 9, 2023

Agreed it's nice to have, pull requests are welcome.

@messense messense added the good first issue Good for newcomers label Jan 9, 2023
@mtantaoui
Copy link

Can I please work on this one please ?

@messense
Copy link
Member

@mahtantaoui No need to ask permission to work on issues, feel free to send pull requests, thanks!

@styvane
Copy link

styvane commented Feb 9, 2023

Can we validate the package name using a combination of an approach similar to the one in Cargo for Rust names and the constraint in PYPI for Python?

@messense
Copy link
Member

Can we validate the package name using a combination of an approach similar to the one in Cargo for Rust names and the constraint in PYPI for Python?

I think so, pull requests are welcome!

@sanmai-NL
Copy link

See also: rust-lang/cargo#12766

@alonme
Copy link
Contributor

alonme commented Mar 23, 2024

Can we validate the package name using a combination of an approach similar to the one in Cargo for Rust names and the constraint in PYPI for Python?

permalink to the pypi/warehouse name constraint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants