Skip to content

Conversation

@sbryngelson
Copy link
Member

@sbryngelson sbryngelson commented Dec 19, 2025

User description

PR Type

Bug fix


Description

  • Add setuptools-scm to pip dependencies for VCS versioning

  • Set environment variables for version metadata generation

  • Enable Homebrew builds from GitHub release tarballs without git


Diagram Walkthrough

flowchart LR
  A["Homebrew Release Tarball<br/>no .git directory"] -->|requires version metadata| B["setuptools-scm<br/>dependency"]
  B -->|needs fallback version| C["Environment Variables<br/>SETUPTOOLS_SCM_PRETEND_VERSION"]
  C -->|enables| D["Successful pip install<br/>of MFC package"]
Loading

File Walkthrough

Relevant files
Bug fix
mfc.rb
Fix VCS versioning for Homebrew builds without git             

packaging/homebrew/mfc.rb

  • Added setuptools-scm to the pip install command for VCS-derived
    versioning support
  • Set three environment variables (SETUPTOOLS_SCM_PRETEND_VERSION,
    SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MFC,
    SETUPTOOLS_SCM_PRETEND_VERSION_FOR_mfc) to provide fallback version
    metadata
  • Added explanatory comment describing why version metadata is needed
    for Homebrew builds from release tarballs without .git directory
+8/-1     


CodeAnt-AI Description

Homebrew: allow mfc install from release tarballs without git metadata

What Changed

  • Homebrew install now includes setuptools-scm so Python package versioning can be generated without a .git directory
  • Environment variables carrying the package version are set during the build so pip can produce required version metadata when installing the mfc toolchain
  • Ensures the mfc toolchain and its dependencies are installed into the virtual environment even when building from GitHub release tarballs

Impact

✅ Fewer Homebrew install failures from release tarballs
✅ Clearer version metadata during pip install
✅ Successful toolchain install without a .git directory

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed package metadata handling during installation from release tarballs, ensuring proper version information is generated.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 19, 2025 13:55
@codeant-ai
Copy link

codeant-ai bot commented Dec 19, 2025

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

Warning

Rate limit exceeded

@sbryngelson has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 19 minutes and 6 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 45090f5 and 8c8a522.

📒 Files selected for processing (1)
  • packaging/homebrew/mfc.rb (1 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The Homebrew formula for MFC is modified to set three environment variables (SETUPTOOLS_SCM_PRETEND_VERSION variants) before package installation, enabling setuptools_scm to generate metadata when building from GitHub release tarballs without a .git directory.

Changes

Cohort / File(s) Summary
Homebrew formula environment setup
packaging/homebrew/mfc.rb
Added three environment variables (SETUPTOOLS_SCM_PRETEND_VERSION, SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MFC, SETUPTOOLS_SCM_PRETEND_VERSION_FOR_mfc) set to formula version before MFC package installation to enable metadata generation from release tarballs

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify all three environment variable names are correctly recognized by setuptools_scm
  • Confirm the version string format (version.to_s) matches setuptools_scm expectations
  • Validate that metadata generation functions correctly when building from GitHub release tarballs

Poem

🐰 A brew so fine, with versions true,
Environment vars—setuptools_scm's cue,
No .git? No fuss, metadata flows,
Three variables dance where the package grows! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning The PR description provides a clear summary of changes, motivation for the fix, includes a helpful diagram, and comprehensive file walkthrough. However, it significantly deviates from the repository's required template structure. Restructure the description to follow the official template exactly, including sections: Description, Type of change (with checkboxes), Scope, How Has This Been Tested, and Checklist. Maintain the detailed explanation but format it according to template requirements.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: fixing Homebrew toolchain installation to work without git metadata by adding version environment variables.

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.

@qodo-code-review
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Reproducibility

setuptools-scm is added as an unpinned build dependency, which can make Homebrew builds less reproducible over time if upstream releases change behavior. Consider pinning the version (or otherwise constraining it) to avoid breakages in bottled builds.

system venv/"bin/pip", "install", "--upgrade", "pip", "setuptools", "wheel", "setuptools-scm"
Duplicate Code

Three environment variables are set for pretend versions (SETUPTOOLS_SCM_PRETEND_VERSION, and two different ..._FOR_MFC/..._FOR_mfc variants). This looks like defensive duplication that may be unnecessary and could hide the correct normalized name. It would be good to confirm the exact dist-name normalization expected by setuptools-scm/hatch-vcs and keep only the needed variable(s).

ENV["SETUPTOOLS_SCM_PRETEND_VERSION"] = version.to_s
ENV["SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MFC"] = version.to_s
ENV["SETUPTOOLS_SCM_PRETEND_VERSION_FOR_mfc"] = version.to_s
Possible Issue

The formula sets a global pretend version variable (SETUPTOOLS_SCM_PRETEND_VERSION) which applies process-wide. If any additional Python packages are installed after this point (now or in future edits), they may accidentally inherit the pretend version and generate incorrect metadata. Prefer using the per-project override only (or tightly scoping when the env var is set) to avoid unintended side effects.

ENV["SETUPTOOLS_SCM_PRETEND_VERSION"] = version.to_s
ENV["SETUPTOOLS_SCM_PRETEND_VERSION_FOR_MFC"] = version.to_s

@codeant-ai codeant-ai bot added the size:XS This PR changes 0-9 lines, ignoring generated files label Dec 19, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where MFC's toolchain installation fails in Homebrew environments that lack git metadata. Since Homebrew builds from GitHub release tarballs without .git directories, and MFC's toolchain uses VCS-derived versioning via hatch-vcs, the build process needs explicit version information.

Key Changes:

  • Adds setuptools-scm as a build dependency to support VCS-based version resolution
  • Sets SETUPTOOLS_SCM_PRETEND_VERSION environment variables to provide fallback version information when git metadata is unavailable

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@codeant-ai
Copy link

codeant-ai bot commented Dec 19, 2025

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Unpinned dependency
    The new pip install adds setuptools-scm without a version constraint. Installing an unpinned tooling dependency in Homebrew builds can lead to future breakage if newer incompatible releases are published. Consider pinning to a known-compatible minimum/maximum range.

  • Global environment mutation
    The install method sets several ENV keys globally (SETUPTOOLS_SCM_PRETEND_VERSION*). These environment changes affect all subsequent commands during the install lifecycle and any child processes. This may unintentionally leak the version into unrelated steps or audits. Prefer scoping environment variables to the single pip installation that needs them.

  • Redundant/odd env variants
    Three slightly different environment variable names are set (SETUPTOOLS_SCM_PRETEND_VERSION, _FOR_MFC, _FOR_mfc). Confirm that all three are required by downstream tooling; if not, reduce to the minimum set to avoid confusion.

@codeant-ai
Copy link

codeant-ai bot commented Dec 19, 2025

CodeAnt AI finished reviewing your PR.

Copy link
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: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2902000 and 45090f5.

📒 Files selected for processing (1)
  • packaging/homebrew/mfc.rb (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packaging/homebrew/mfc.rb (1)
toolchain/mfc/common.py (1)
  • system (34-41)
⏰ 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). (3)
  • GitHub Check: Full Installation Test
  • GitHub Check: Cursor Bugbot
  • GitHub Check: Build & Publish
🔇 Additional comments (1)
packaging/homebrew/mfc.rb (1)

32-32: LGTM! Necessary dependency added.

Adding setuptools-scm is required for the version metadata generation fix that follows.

@sbryngelson sbryngelson merged commit 46ffb97 into MFlowCode:master Dec 19, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 2/5 size:XS This PR changes 0-9 lines, ignoring generated files

Development

Successfully merging this pull request may close these issues.

1 participant