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

fix(dependency_getter): avoid error on empty dependencies #752

Merged

Conversation

mkniewallner
Copy link
Collaborator

@mkniewallner mkniewallner commented Jul 4, 2024

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

We currently hard access dependencies key for both PEP 621 and Poetry projects to retrieve dependencies. Although not common, it could happen that projects use deptry, but do not have any production dependencies (for instance when bootstrapping a project from a minimal template, where you don't start with any dependency, but still want to include deptry in the CI workflow).

This PR soft accesses dependencies for both PEP 621 and Poetry. As for Poetry, we rely on dependencies to determine if a project uses Poetry, the logic is also updated to assume that a project uses by only checking [tool.poetry] instead of [tool.poetry.dependencies]. This should not be problematic, as [tool.poetry] is specific to Poetry, and Poetry only.

@mkniewallner mkniewallner marked this pull request as ready for review July 5, 2024 00:02
@mkniewallner mkniewallner requested a review from fpgmaas July 5, 2024 00:02
Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@0820845). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             main    #752   +/-   ##
======================================
  Coverage        ?   93.0%           
======================================
  Files           ?      35           
  Lines           ?     920           
  Branches        ?     165           
======================================
  Hits            ?     856           
  Misses          ?      50           
  Partials        ?      14           

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

@mkniewallner mkniewallner force-pushed the fix/avoid-error-empty-dependencies branch from c2c34bf to 4baaadb Compare July 5, 2024 07:02
@mkniewallner mkniewallner enabled auto-merge (squash) July 5, 2024 07:02
@mkniewallner mkniewallner merged commit 244d753 into fpgmaas:main Jul 5, 2024
20 checks passed
@mkniewallner mkniewallner deleted the fix/avoid-error-empty-dependencies branch July 5, 2024 07:47
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