Skip to content

Conversation

kevalmorabia97
Copy link
Collaborator

@kevalmorabia97 kevalmorabia97 commented Sep 16, 2025

What does this PR do?

torchvision is only used in tests so we should not make it default dependency

Summary by CodeRabbit

  • Chores
    • Updated installation dependencies: torchvision is no longer installed by default.
    • To include torchvision, install using the dev-test extra (e.g., pip install .[dev-test]).
    • This change reduces default install size and avoids unnecessary dependencies for users who don’t need torchvision.

@kevalmorabia97 kevalmorabia97 requested a review from a team as a code owner September 16, 2025 11:48
Copy link

coderabbitai bot commented Sep 16, 2025

Walkthrough

Moved torchvision from install-time required dependencies to an optional extra under dev-test in setup.py. No changes to exported/public entity signatures.

Changes

Cohort / File(s) Summary
Dependency configuration
setup.py
Removed torchvision from required_deps; added torchvision to optional_deps["dev-test"] to enable opt-in installation via extras.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my ears at deps that shift,
From always-on to optional gift.
Dev-test trails now light the way,
Torch visions come when bunnies say.
Hop, select, install with cheer—
Extras nibble neatly here.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Move torchvision dependency to optional dev-test group" succinctly and accurately describes the primary change in this PR — relocating torchvision from default install requirements into the dev-test extras because it is only used in tests; it is specific, concise, and relevant to the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kmorabia/torchvision-dep-test

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kevalmorabia97 kevalmorabia97 deleted the kmorabia/torchvision-dep-test branch September 16, 2025 11:59
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
setup.py (1)

104-109: Avoid duplicated extras in the 'dev' aggregator.
Including the newly added "all" list inside "dev" duplicates entries. Not harmful, but noisy and nondeterministic across changes. Simple tidy-up:

-optional_deps["dev"] = [deps for k in optional_deps for deps in optional_deps[k]]
+# Exclude the aggregated "all" key to avoid duplication; order remains stable
+optional_deps["dev"] = [dep for k, deps in optional_deps.items() if k != "all" for dep in deps]
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9aedfdf and b8d08f8.

📒 Files selected for processing (1)
  • setup.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: linux
  • GitHub Check: wait-checks / wait
  • GitHub Check: code-quality
  • GitHub Check: build-docs
🔇 Additional comments (2)
setup.py (2)

75-84: Pin torchvision to a torch-compatible range or add CI constraints

Unpinned "torchvision" in setup.py dev-test extras (setup.py, lines 75–84) can resolve to a torchvision incompatible with the installed torch and cause operator/ABI/runtime errors. Either:

  • Pin torchvision to match your torch (examples: torch 2.6 → torchvision 0.21., torch 2.7 → torchvision 0.22., torch 2.8 → torchvision 0.23.*).
  • Or keep it unpinned here but add a constraints file used by tox/CI that pins a known-good torch/torchvision pair.

75-84: Move torchvision to dev-test extra — LGTM; tox/CI already wired, but verify no runtime imports.

  • Evidence: setup.py contains the dev-test extra (~line 75); tox.ini installs -e .[all,dev-test] in unit/GPU envs and references dev-test in partial-unit envs; docker/Dockerfile references [all,dev-test].
  • Action required: confirm there are no runtime imports of torchvision in non-test code (search for "import torchvision" and dynamic imports). Tests that require torchvision should use pytest.importorskip('torchvision') or run under CI/tox that installs the dev-test extra.

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.

1 participant