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

Some improvements over init command #5838

Merged
merged 6 commits into from
Jun 15, 2022
Merged

Some improvements over init command #5838

merged 6 commits into from
Jun 15, 2022

Conversation

mkniewallner
Copy link
Member

Pull Request Check List

Resolves: #2554

  • Added tests for changed code.
  • Updated documentation for changed code.

Few improvements over init command:

  • don't ask for description if already set through the CLI, similarly to what we do for other arguments
  • don't ask for license if already set through the CLI and remove useless license validator, since it doesn't raise any error if set to empty or invalid (see the removed _validate_package and poetry-core helper that can confirm that)
  • validate package definition by not accepting more than 2 whitespace separated parts, to validate the following things:
  • reword package add prompt a bit to better indicate that a search through PyPI is performed when only specifying the name of the dependency

On a non-directly related note, I was thinking that it would be nice to be able to pass validators to the different options of the command, similarly to what we can already do in cleo for questions.

Right now, we are only able to apply the validators on interactive mode, but not when the user provides the options through the CLI.

Going even further and additionally to this, maybe adding a dedicated boolean in option could make it possible to automatically ask questions if an argument is not provided?
That way, the validator would be on option, and if the user doesn't provide it through the CLI, then they are asked to provide it, without having to create the question ourselves, and with the exact same validator as for option.

@neersighted neersighted merged commit 921ce26 into python-poetry:master Jun 15, 2022
@mkniewallner mkniewallner deleted the improvements-over-init-command branch June 15, 2022 22:46
@mkniewallner mkniewallner mentioned this pull request Jul 12, 2022
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent badly-formatted dependencies from erroring poetry init
2 participants