maturin icon indicating copy to clipboard operation
maturin copied to clipboard

Add validation for crate/package name in new/init

Open alonme opened this issue 2 years ago • 2 comments

solves https://github.com/PyO3/maturin/issues/1398

The current commit only adds a very basic validation as a POC before implementing the needed cargo / pypi checks A few questions i have before finishing the implementation

  1. The cargo validation seems to be comprised of 2 main parts, a. Basic validation which is part of the crate cargo-util-schemas, and is not made public outside the crate

    b. Extra validations that are public from the cargo package

    I believe we should vendor these logics - one is private, and the other requires the cargo package which i believe will add many dependencies to the project

  2. The generate_project function is de-facto defining a default value for GenerateProjectOptions.name - would it be better to move this logic into GenerateProjectOptions?

alonme avatar Feb 17 '24 21:02 alonme

Deploy Preview for maturin-guide ready!

Built without sensitive environment variables

Name Link
Latest commit 9b21beb3fc12603bc124e2b978f7b9244fcfd6f0
Latest deploy log https://app.netlify.com/sites/maturin-guide/deploys/65d9fb0ee8676600086e03ee
Deploy Preview https://deploy-preview-1943--maturin-guide.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Feb 17 '24 21:02 netlify[bot]

  1. I believe we should vendor these logics - one is private, and the other requires the cargo package which i believe will add many dependencies to the project

Agreed.

2. The generate_project function is de-facto defining a default value for GenerateProjectOptions.name - would it be better to move this logic into GenerateProjectOptions?

Makes sense.

messense avatar Feb 19 '24 02:02 messense

@messense I believe this is ready for review 😄

alonme avatar Feb 24 '24 14:02 alonme

@messense Thanks!

alonme avatar Feb 27 '24 12:02 alonme