Skip to content

chore: Remove mpmath constraints that lead to improper environment - #1454

Merged
Czaki merged 4 commits into
developfrom
fix_pyinstaller
Aug 25, 2026
Merged

chore: Remove mpmath constraints that lead to improper environment#1454
Czaki merged 4 commits into
developfrom
fix_pyinstaller

Conversation

@Czaki

@Czaki Czaki commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Add an option to easily reproduce the problem locally using tox.

Closes #1451

Summary by Sourcery

Provide a tox workflow to reproduce and validate the problematic PyInstaller dependency environment.

Enhancements:

  • Add a dedicated tox environment for reproducing problematic pre-release dependency resolutions in the PyInstaller build.

Build:

  • Remove the problematic-version requirement constraints used during pre-test setup.

Tests:

  • Add automated build and smoke-test coverage for the PyInstaller executable under the problematic dependency environment.

Summary by CodeRabbit

  • Bug Fixes

    • Updated dependency compatibility rules to support additional prerelease versions.
  • Tests

    • Added validation for building and running the packaged application with prerelease-compatible dependencies.
  • Chores

    • Improved automated environment setup for testing executable builds.

add option to easy reproduce problem locally using tox
@sourcery-ai

sourcery-ai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR removes restrictive mpmath constraints and adds a pyinstaller-pre tox environment that reproduces the pre-release dependency resolution, packages the application, and runs the packaged executable's self-test to verify the environment.

Flow diagram for pre-release packaged environment validation

flowchart TD
    A[pyinstaller-pre tox environment] --> B[uv pip compile with prerelease dependencies]
    B --> C[Install compiled requirements]
    C --> D[Install PartSeg without dependencies]
    D --> E[Build and package executable]
    E --> F[Run packaged executable self-test]
Loading

File-Level Changes

Change Details Files
Adds a dedicated tox environment for reproducing the problematic pre-release dependency setup and validating the packaged application.
  • Compiles dependencies with prereleases enabled and the problematic-version requirements input.
  • Installs the compiled requirements plus the project without dependencies.
  • Builds the executable and runs its self-test after packaging.
  • Allows tox to execute the generated packaged binary.
  • Removes the problematic-version requirements file entries.
requirements/pre_test_problematic_version.txt
tox.ini

Assessment against linked issues

Issue Objective Addressed Explanation
#1451 Fix the failing PyInstaller --pre workflow by removing the mpmath version constraints that produce an improper dependency environment.
#1451 Provide a convenient way to reproduce and validate the problematic PyInstaller prerelease environment locally.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

Next included review available in 35 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fc2a0d1f-7366-4927-bd03-d8d5f28d1c99

📥 Commits

Reviewing files that changed from the base of the PR and between fc622fa and a2c814c.

📒 Files selected for processing (1)
  • tox.ini

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ad38c4af-c889-4125-931a-eb0f75339660

📥 Commits

Reviewing files that changed from the base of the PR and between 3c0253d and fc622fa.

📒 Files selected for processing (2)
  • requirements/pre_test_problematic_version.txt
  • tox.ini
💤 Files with no reviewable changes (1)
  • requirements/pre_test_problematic_version.txt

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The changes update problematic-version requirements and add a pyinstaller-pre tox environment. The environment resolves prerelease dependencies, builds the executable without dependency installation, and runs the executable test command.

Changes

Prerelease PyInstaller validation

Layer / File(s) Summary
Configure prerelease dependency and bundle validation
requirements/pre_test_problematic_version.txt, tox.ini
The requirements remove the mpmath exclusions. The new tox environment resolves prerelease dependencies, builds the executable, and runs its _test command.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fc622

This change removes restrictive dependency constraints and adds a local reproduction environment; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: removing restrictive mpmath constraints that cause an improper dependency environment.
Linked Issues check ✅ Passed The changes address issue #1451 by removing the problematic mpmath constraints and adding a pyinstaller-pre tox environment to reproduce and validate the prerelease dependency scenario.
Out of Scope Changes check ✅ Passed All changes are related to the linked issue. The requirements update addresses the dependency problem, and the tox environment supports local reproduction and executable validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix_pyinstaller

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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="tox.ini" line_range="121-123" />
<code_context>
+allowlist_externals =
+    dist/PartSeg/PartSeg
+commands_pre =
+    uv pip compile --prerelease allow --python-version {py_dot_ver} --upgrade -o {envtmpdir}/requirements-pyinstaller-pre.txt pyproject.toml requirements/pre_test_problematic_version.txt --extra pyinstaller
+    uv pip install -r {envtmpdir}/requirements-pyinstaller-pre.txt
+    uv pip install --no-deps .
</code_context>
<issue_to_address>
**issue (bug_risk):** tox rejects the first `uv pip compile` command as an unallowlisted external command, so `pyinstaller-pre` stops before compiling or installing its requirements.

**Triggers:** When running `tox run -e pyinstaller-pre` under tox 4.

**Suggested fix:** Add `uv` to `allowlist_externals` and ensure the uv executable is installed or otherwise available on PATH.

```suggestion
allowlist_externals =
    dist/PartSeg/PartSeg
    uv
deps =
    uv
commands_pre =
```
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: tox.ini:123


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread tox.ini

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@Czaki Czaki changed the title Remove mpmath constraints that lead to improper environment chore: Remove mpmath constraints that lead to improper environment Aug 25, 2026
@Czaki Czaki added this to the 0.17.1 milestone Aug 25, 2026
@sonarqubecloud

Copy link
Copy Markdown

@Czaki
Czaki merged commit 835edb1 into develop Aug 25, 2026
64 checks passed
@Czaki
Czaki deleted the fix_pyinstaller branch August 25, 2026 12:44
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.

[test-bot] pyinstaller bundle --pre is failing

1 participant