Skip to content
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

Project type usage preparations #9742

Merged
merged 4 commits into from
Jan 14, 2025
Merged

Project type usage preparations #9742

merged 4 commits into from
Jan 14, 2025

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

Align with the "legacy" Gradle `GradleDependencyHandler`, also see
666120a.

Signed-off-by: Sebastian Schuberth <[email protected]>
Previously, the `projectType` was "PIP" if the former was called via
Pipenv or Poetry. Fix this to now use dedicated project types for the
latter.

Signed-off-by: Sebastian Schuberth <[email protected]>
@sschuberth sschuberth requested a review from a team as a code owner January 14, 2025 16:28
@sschuberth sschuberth enabled auto-merge (rebase) January 14, 2025 16:28
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.08%. Comparing base (35095c4) to head (a16e73d).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #9742   +/-   ##
=========================================
  Coverage     68.08%   68.08%           
  Complexity     1293     1293           
=========================================
  Files           249      249           
  Lines          8845     8845           
  Branches        923      923           
=========================================
  Hits           6022     6022           
  Misses         2434     2434           
  Partials        389      389           
Flag Coverage Δ
funTest-docker 65.02% <ø> (ø)
funTest-non-docker 33.30% <ø> (ø)
test-ubuntu-24.04 35.91% <ø> (ø)
test-windows-2022 35.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

val pipenvAnalyzerConfig = analyzerConfig
.withPackageManagerOption(managerName, "overrideProjectType", projectType)

return Pip(managerName, analysisRoot, pipenvAnalyzerConfig, repoConfig)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of scope: Is it actually fine to create a new instance of Pip each time? (IIRC dependency graph building relies on using only once instance)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC dependency graph building relies on using only once instance

Actually, the requirement is that not multiple package managers that manage the same project type are enabled at the same time:

// TODO: Relax this assumption that package manager names start with the name of the type of project
// they manage, for example that "GradleInspector" manages "Gradle" projects.
val managers = graphs.keys.filter { it.startsWith(project.id.type) }
val manager = requireNotNull(managers.singleOrNull()) {
"All of the $managers managers are able to manage '${project.id.type}' projects. Please enable only one " +
"of them."
}

So, as this commit fixes the multiple Pip instances to have different project types, we should be good.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, I believe I was after a different requirement, was it that same DependencyGraphBuilder or Handler instance needs to be used, maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea...

@sschuberth sschuberth merged commit fdc2be7 into main Jan 14, 2025
26 checks passed
@sschuberth sschuberth deleted the project-type-preps branch January 14, 2025 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants