Skip to content

ci: pin torch version v2#10340

Closed
Adam-Aghili wants to merge 2 commits into
mainfrom
aka-pin-torch-version
Closed

ci: pin torch version v2#10340
Adam-Aghili wants to merge 2 commits into
mainfrom
aka-pin-torch-version

Conversation

@Adam-Aghili
Copy link
Copy Markdown
Collaborator

@Adam-Aghili Adam-Aghili commented Oct 20, 2025

second attempt to pin the torch version to cpu only.

first PR passed ci/cd but once merged started failing. it looked like the the torch versions where not being properly cleaned up between steps which might indicate a larger issue. I will use this PR to both investigate pinning the torch version and also checking on our ci health and seeing if there are other optimizations we can make.

Summary by CodeRabbit

  • Chores
    • Updated networkx version constraint to support a broader compatibility range.
    • Added platform and Python version-specific dependency configurations to support installation across Linux, Windows, and Python 3.10–3.13.

second attempt to pin the torch version to cpu only.

first PR passed ci/cd but once merged started failing.
it looked like the the torch versions where not being properly cleaned up between steps which might indicate a larger issue.
I will use this PR to both investigate pinning the torch version and also checking on our ci health and seeing if there are other optimizations we can make.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 20, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Updated pyproject.toml to relax the networkx version constraint from a pinned version to a range (>=3.1,<4.0.0), added conditional torch wheel dependencies for multiple platforms and Python versions (3.10–3.13), and enabled direct-reference metadata support for the Hatch build system.

Changes

Cohort / File(s) Summary
Dependency Updates
pyproject.toml
Loosened networkx constraint from ==3.4.2 to >=3.1,<4.0.0. Added platform- and Python-version-specific torch wheel entries for Linux (x86_64, aarch64), Windows (amd64), and Python 3.10–3.13. Enabled [tool.hatch.metadata] allow-direct-references = true to support direct URL references in dependencies.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • langflow-ai/langflow#10337: Directly reverts the torch wheel and allow-direct-references changes introduced in this PR.
  • langflow-ai/langflow#10185: Adds similar platform- and Python-version-specific torch wheel entries alongside the same [tool.hatch.metadata] configuration.

Suggested labels

lgtm

Suggested reviewers

  • ogabrielluiz
  • jordanrfrazier

Pre-merge checks and finishing touches

❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Test Quality And Coverage ❓ Inconclusive PR #10340 is exclusively a configuration change that modifies only pyproject.toml to pin torch to CPU-only version 2.8.0 with conditional wheels for different platforms and Python versions. The git commit confirms that no test files were added, modified, or deleted—only the pyproject.toml file was changed. The custom check is designed to evaluate test quality and coverage for new code implementations, including testing of main functionality, async patterns, behavioral validation, and API error responses. Since this PR introduces no new functional code, business logic, functions, classes, or API endpoints—only dependency management configuration—there are no tests to evaluate against the specified criteria. The "Test Quality and Coverage" check is designed to assess test coverage for new code implementations but is inapplicable to configuration-only changes. This PR contains only dependency pinning configuration with no code changes. Either confirm that this check should only apply to PRs with code changes (making it not applicable here), or if configuration changes require validation, define specific test requirements for infrastructure changes (such as integration tests verifying torch wheel selection for different platform/Python combinations).
Test File Naming And Structure ❓ Inconclusive This PR only modifies pyproject.toml to pin the torch version to CPU-only wheels and relax the networkx constraint. No test files are added, modified, or changed in this pull request. The custom check instructions specify verification of test file patterns, naming conventions, structure, and test organization, but these criteria cannot be evaluated since the PR contains no test files whatsoever. The PR is purely a configuration and dependency management change. The "Test File Naming and Structure" check is not applicable to this PR as it only modifies dependency configuration in pyproject.toml and does not include any test files. This check would be applicable if the PR added or modified backend tests (test_.py), frontend tests (.test.ts/tsx), integration tests, or other test-related files. For configuration-only PRs like this one, verify whether test files should be included (e.g., to test the new torch pinning configuration) or clarify if this check should be skipped for dependency-only changes.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "ci: pin torch version v2" directly corresponds to the primary change in the PR, which is adding torch wheel entries with platform and Python-version conditional selectors to ensure proper torch versioning. The "v2" designation appropriately indicates this is a second attempt, aligning with the PR objectives. The title is clear, specific, and concise without vague language or excessive noise. While the changeset includes secondary modifications (networkx constraint relaxation and allow-direct-references metadata), the title appropriately emphasizes the main focus that the developer identified. A teammate scanning the repository history would readily understand that this PR addresses torch version pinning.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Test Coverage For New Implementations ✅ Passed The PR modifies only the pyproject.toml configuration file with two types of changes: (1) relaxing the networkx dependency constraint from exact version 3.4.2 to a range >=3.1,<4.0.0, and (2) pinning torch to CPU-only wheel distributions for multiple platforms and Python versions, along with adding the allow-direct-references metadata setting. The git diff confirms that no test files were added or modified, and the changes contain no new code implementations, features, or bug fixes to the codebase—only dependency and configuration management. Since the check is specifically for "Test Coverage for New Implementations," and this PR contains zero new code implementations, components, features, or bug fixes, the test coverage check criteria do not apply.
Excessive Mock Usage Warning ✅ Passed The PR modifies only the pyproject.toml file with 17 additions and 1 deletion, specifically updating the networkx dependency constraint and adding torch wheel entries with platform and Python version guards. The check for "Excessive Mock Usage Warning" is designed to review test files for inappropriate mock usage patterns, but this PR contains no modifications to test files or test-related code. The changes are purely configuration and dependency declarations, which cannot have excessive mock usage by definition.

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.

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 30.22%. Comparing base (621c103) to head (27981b0).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #10340   +/-   ##
=======================================
  Coverage   30.22%   30.22%           
=======================================
  Files        1315     1315           
  Lines       59290    59290           
  Branches     8876     8876           
=======================================
+ Hits        17921    17922    +1     
  Misses      40551    40551           
+ Partials      818      817    -1     
Flag Coverage Δ
backend 51.16% <ø> (ø)
lfx 40.13% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@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)
pyproject.toml (1)

126-138: Monitor CI caching behavior post-merge; consider infrastructure improvements.

The PR description notes that the first attempt passed CI but failed post-merge due to torch versions not being cleaned up between CI steps. While this code change pins torch to an exact version (2.8.0+cpu), it does not directly fix the underlying caching or cleanup logic.

Recommendation: After this PR merges, verify that the CI/CD pipeline correctly clears or invalidates torch caches between steps (e.g., pip cache purge or equivalent), or uses dependency lock files (e.g., uv.lock) to enforce reproducibility. Otherwise, similar issues may resurface even with the pinned version.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 956e356 and 27981b0.

📒 Files selected for processing (1)
  • pyproject.toml (3 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). (12)
  • GitHub Check: Lint Backend / Run Mypy (3.11)
  • GitHub Check: Lint Backend / Run Mypy (3.10)
  • GitHub Check: Lint Backend / Run Mypy (3.12)
  • GitHub Check: Lint Backend / Run Mypy (3.13)
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 5
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 3
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 1
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 4
  • GitHub Check: Run Backend Tests / Unit Tests - Python 3.10 - Group 2
  • GitHub Check: Run Backend Tests / Integration Tests - Python 3.10
  • GitHub Check: Run Backend Tests / LFX Tests - Python 3.10
  • GitHub Check: Test Starter Templates
🔇 Additional comments (3)
pyproject.toml (3)

25-25: Verify networkx range compatibility before merging.

Relaxing networkx from a pinned version (==3.4.2) to a broader range (>=3.1,<4.0.0) increases flexibility but risks compatibility issues if intermediate versions introduced breaking changes. Confirm that langflow has been tested (or is known to be compatible) with all networkx versions in the [3.1, 4.0.0) range, especially 3.1–3.3 and any patch versions after 3.4.2.


220-221: Configuration to support direct-reference torch URLs is correct.

The allow-direct-references = true setting enables Hatch to resolve the torch direct-reference URLs (lines 126–138). This is the correct and necessary configuration for PEP 508 direct references.


126-138: The torch wheel URLs are all accessible. Now I need to verify the Python 3.14 coverage concern.

I found important information about Python 3.14 support. Let me check the project's requires-python constraint in the pyproject.toml:

Based on the web search results, I can now confirm the Python 3.14 situation. PyTorch 2.9.0 is the first version with Python 3.14 support (as preview), while PyTorch 2.8.0 has no Python 3.14 wheels. The gap in the review comment is valid but expected.

Now let me verify the project's actual requires-python constraint:

Based on my verification, here is the rewritten review comment:


All torch wheel URLs are accessible; Python 3.14 coverage is not available in PyTorch 2.8.0.

The 12 torch direct-reference URLs all return HTTP 200 and are live. However, PyTorch 2.8.0 does not support Python 3.14; support is available only in PyTorch 2.9.0 as a preview. If your project's requires-python extends to 3.14, users on that version will lack torch at install time. Confirm whether supporting Python 3.14 is intentional, and if so, consider upgrading to PyTorch 2.9.0 or newer.

Copy link
Copy Markdown
Collaborator

@lucaseduoli lucaseduoli left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants