Some improvements over init command#5838
Merged
neersighted merged 6 commits intopython-poetry:masterfrom Jun 15, 2022
mkniewallner:improvements-over-init-command
Merged
Some improvements over init command#5838neersighted merged 6 commits intopython-poetry:masterfrom mkniewallner:improvements-over-init-command
init command#5838neersighted merged 6 commits intopython-poetry:masterfrom
mkniewallner:improvements-over-init-command
Conversation
neersighted
approved these changes
Jun 15, 2022
Merged
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Check List
Resolves: #2554
Few improvements over
initcommand:licensevalidator, since it doesn't raise any error if set to empty or invalid (see the removed_validate_packageand poetry-core helper that can confirm that)requests(valid, will search on PyPI API)requests@^2.0(valid)requests 2.0(valid)requests 2.0 foo(invalid, and crashing today, as highlighted by Prevent badly-formatted dependencies from erroringpoetry init#2554)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
cleofor 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
optioncould 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 foroption.