poetry: expose build-system dependencies#319
Merged
Merged
Conversation
1386faf to
99e8da4
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
|
Kudos, SonarCloud Quality Gate passed! |
4 tasks
2ae4888 to
7bd850e
Compare
Member
Author
|
@sourcery-ai review |
Reviewer's Guide by SourceryThis pull request exposes the build-system dependencies of a Poetry project as Sequence diagram for build system dependency resolutionsequenceDiagram
participant Poetry
participant PyProjectTOML
participant Dependency
Poetry->>PyProjectTOML: Get build_system
PyProjectTOML-->>Poetry: Return build system config
loop For each requirement
Poetry->>Dependency: create_from_pep_508(requirement)
alt PEP 508 parsing successful
Dependency-->>Poetry: Return Dependency instance
else PEP 508 parsing failed
Note over Poetry: Try as file/directory path
alt Is file
Poetry->>Poetry: Create FileDependency
else Is directory
Poetry->>Poetry: Create DirectoryDependency
end
end
end
Class diagram showing Poetry class modificationsclassDiagram
class Poetry {
-_build_system_dependencies: list[Dependency]
+pyproject: PyProjectTOML
+package: ProjectPackage
+local_config: dict[str, Any]
+build_system_dependencies: list[Dependency]
+get_project_config(config: str, default: Any): Any
}
class Dependency {
+create_from_pep_508(requirement: str): Dependency
}
class FileDependency {
+name: str
+path: Path
}
class DirectoryDependency {
+name: str
+path: Path
}
Poetry --> "*" Dependency : has
FileDependency --|> Dependency : extends
DirectoryDependency --|> Dependency : extends
note for Poetry "New property build_system_dependencies
parses requirements into Dependency objects"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey @abn - I've reviewed your changes - here's some feedback:
Overall Comments:
- The test appears to have issues: there's a typo in the parameter name 'requries' and the test implementation doesn't match the parametrized cases - it only tests 'sample_project' while declaring two different test scenarios.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 3 issues found
- 🟢 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.
7bd850e to
13ad55a
Compare
Member
Author
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey @abn - I've reviewed your changes - here's some feedback:
Overall Comments:
- There appears to be a bug in the logging - the 'Skipping build system dependency' debug message is logged when a dependency is successfully added, which is incorrect. The log message should either be moved to the else branch when skipping, or the message should be changed to indicate successful addition.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟡 Testing: 1 issue found
- 🟢 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.
13ad55a to
f0c2db9
Compare
finswimmer
approved these changes
Jan 17, 2025
3 tasks
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.









This change allows for a Poetry project instance's build-system requirements to be accessed as
Dependencyinstances. Preserving useful parsing from #58 as original PR was dropped.Summary by Sourcery
New Features:
Dependencyinstances.