Validate pyproject.toml before installing dependencies #1066
+668 −21
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.
This PR implements validation for
pyproject.tomlwhen installing dependencies, addressing issue #411. It's an initial implementation that covers some most common formatting errors, we can definitely expand coverage as we receive user feedback.This PR
pyproject.tomladheres to relevant PEP standards (PEP 508, PEP 440, PEP 621, PEP 518) before attempting to install packages from it and provides feedback when validation fails, allowing the user to fix the file or proceed if they choose.It added
validatePyprojectTomlinpipUtils.tswhich checks:shouldProceedAfterPyprojectValidationto display an error message with options to "Open pyproject.toml", "Continue Anyway", or "Cancel", only when user selects dependencies from incorrectly formattedpypyroject.tomlfile to install when creating environment.Example user flow:
Recording.2025-12-15.115457.mp4
helpers.validatePyproject.unit.test.tswith comprehensive unit tests.