Skip to content

Feature/cran r dependency support - #475

Draft
MoralCode wants to merge 4 commits into
mainfrom
guptapratykshh/feature/cran-r-dependency-support
Draft

MoralCode wants to merge 4 commits into
mainfrom
guptapratykshh/feature/cran-r-dependency-support

Conversation

@MoralCode

Copy link
Copy Markdown
Contributor

Note

This PR was ported from augurlabs/augur#3510 filed by @guptapratykshh because the contribution was deemed to still be useful.

Description
This PR adds support for analyzing R package dependencies, enabling Augur to detect and count R dependencies in repositories.

  • Implemented collectoss/tasks/git/dependency_tasks/dependency_util/r_deps.py, which supports parsing:
    • Extracts dependencies from standard fields (Imports, Depends, Suggests, Enhances, LinkingTo). Handles Debian Control Format (DCF) parsing including multi-line values.
    • renv.lock files: Parses JSON-formatted lockfiles from the renv package manager.
  • Integrated the R dependency parser into the main dependency_calculator.py.
  • Added a new test suite in tests/test_tasks/test_dependency_tasks/test_r_deps.py covering parsing logic and file discovery.

This PR fixes #145
Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

guptapratykshh and others added 4 commits September 14, 2026 18:26
Signed-off-by: Pratyksh Gupta <pratykshgupta9999@gmail.com>
Signed-off-by: Pratyksh Gupta <pratykshgupta9999@gmail.com>
- Refactor tests to use pytest syntax and fixtures.

- Clarify version stripping in r_deps.py.

Signed-off-by: Pratyksh Gupta <pratykshgupta9999@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
from collectoss.tasks.git.dependency_tasks.dependency_util import kotlin_deps
from collectoss.tasks.git.dependency_tasks.dependency_util import rust_deps
from collectoss.tasks.git.dependency_tasks.dependency_util import r_deps
from collectoss.tasks.git.dependency_tasks.dependency_util import dependency_calculator

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0611: Unused dependency_calculator imported from collectoss.tasks.git.dependency_tasks.dependency_util (unused-import)

@@ -0,0 +1,90 @@
import json
import pytest

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[pylint] reported by reviewdog 🐶
W0611: Unused import pytest (unused-import)

@MoralCode

Copy link
Copy Markdown
Contributor Author

The competing PR with this (from augur) was closed due to containing unrelated changes.

  • reviewed for project renaming and remediated

Needs testing

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.

Support analysis of CRAN (R package) dependencies

2 participants