-
Notifications
You must be signed in to change notification settings - Fork 256
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
fix(pyproject): relax validation for non-packages #813
Conversation
Reviewer's Guide by SourceryThis pull request fixes an issue where non-package projects were required to adhere to strict project section requirements. It does so by relaxing the validation for non-packages. Sequence diagram for project validation processsequenceDiagram
participant Client
participant Factory
participant Validator
Client->>Factory: validate()
activate Factory
Factory->>Factory: get project data
Factory->>Validator: validate_object(project, 'project-schema')
activate Validator
Note over Validator: Filter validation errors<br/>Skip name/version if non-package
Validator-->>Factory: filtered validation errors
deactivate Validator
Factory-->>Client: validation result
deactivate Factory
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @abn - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider moving the regex pattern to module level since it's a constant, though this is a minor optimization.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am all for that. Consider it approved from my side.
Thus, we will allow to violate the standard in non-package mode? |
Yeah, thinking is in a non-package mode those are not required and seems to be a foot gun mostly. But that is just my thinking atm, I am not strongly for or against this approach. Seems better as user's seem to not expect non-packages to need these properties - I tend to agree, at least for version. |
ec5eda5
to
0fc7b32
Compare
that is of course exactly the objection to this approach. (All these years of folk beating up on poetry for not following PEP621 - and now here we go...!) IMO the compliant and consistent thing is to tell people that if they don't want a package then they shouldn't be using the (In that case, it may be that that there are some While I think this all is mostly not very important, I bet that it will sooner or later cause bug reports and incompatibilities. Eg there will be folk using some tool |
I agree with @dimbleby as already mentioned on discord. :) If we keep the current behavior, we could at least improve the error message to guide people into the correct direction. |
I guess if you wanted to talk yourself into believing that what is proposed here is compliant, you could argue that
I don't love this line of reasoning! But it has its merits. A hole in this logic again comes with other tools
|
We could also take a middle path: We do not create non-compliant |
This is what motivated me proposing this. If we say that properties available in
Does this mean poetry wont use |
To add to this, we could also improve cli usability to add features that let users do |
My thinking was that Poetry will use the Your proposal solves the |
I am okay with that approach. In this case I think we can reject this and make the needed changes in the frontend. |
Yes, many of us see PEP 621 (for all of its ... unfortunate design choices for
This was my original thinking for python-poetry/poetry#10031 as well. I see the requirements imposed on But I can also see the counter argument against this. As example what other tools do in this space, |
Relates-to: python-poetry/poetry#10031 python-poetry/poetry#10032
Proposing this fix to see what the team makes of this. This ensures that non-package projects do not need to adhere to strict project section requirements.
Summary by Sourcery
Relax project metadata validation for non-package projects.
Bug Fixes:
Tests: