fix(factory): safe get extras in scripts and config#404
Merged
neersighted merged 1 commit intopython-poetry:mainfrom Jun 26, 2022
Merged
fix(factory): safe get extras in scripts and config#404neersighted merged 1 commit intopython-poetry:mainfrom
extras in scripts and config#404neersighted merged 1 commit intopython-poetry:mainfrom
Conversation
Member
Author
|
The tests that is failing does not seem related to the changes in the PR. |
TBBle
previously approved these changes
Jun 24, 2022
3 tasks
86fb7d1 to
40d6341
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
Member
Author
|
Rebased from |
neersighted
approved these changes
Jun 26, 2022
Merged
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.








Resolves: python-poetry/poetry#4665
Updated documentation for changed code.Not applicableAccording to:
poetry-core/src/poetry/core/json/schemas/poetry-schema.json
Lines 6 to 10 in 3bf7ad0
poetry-core/src/poetry/core/json/schemas/poetry-schema.json
Lines 597 to 600 in 3bf7ad0
extrasis not required in the main config (underpoetry.tools.extras)extrasis not required when defining a script (underpoetry.tools.scripts) using the syntax introduced in Added script file feature #40Despite that,
Factory.validateassumes thatextraskey is always present for both cases by hard accessing it, making the script definition fail for 2 possible reasons:poetry.tool.extrasis not defined at allextraskeyThis PR fixes those 2 use cases by soft accessing the key and defaulting to an empty list/dict.
It also adds tests to validate the errors/warnings that could happen when using the
strictflag, since it was lacking some coverage.