Skip to content

fix: run of circular-dependencies with python3.15#7396

Open
knst wants to merge 1 commit into
dashpay:developfrom
knst:fix-multiprocess-3.15
Open

fix: run of circular-dependencies with python3.15#7396
knst wants to merge 1 commit into
dashpay:developfrom
knst:fix-multiprocess-3.15

Conversation

@knst

@knst knst commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Multiprocess uses dill to pickle the nested handle_module2 closure and dill's Python 3.15 support is broken (co_lnotab was removed from code objects).

What was done?

Moved some functions and variables to global namespace.

How Has This Been Tested?

Run test/lint/lint-circular-dependencies.py with python3.15
Review hint: use git show -w --color-moved=dimmed-zebra

Breaking Changes

Please describe any breaking changes your code introduces

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

Multiprocess uses dill to pickle the nested handle_module2 closure
and dill's Python 3.15 support is broken (co_lnotab was removed from code objects).

Review hint: use `git show -w --color-moved=dimmed-zebra`
@knst knst added this to the 24 milestone Jul 1, 2026
@thepastaclaw

thepastaclaw commented Jul 1, 2026

Copy link
Copy Markdown

✅ Review complete (commit 0fe8e05)

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

⚠️ Potential Merge Conflicts Detected

This PR has potential conflicts with the following open PRs:

Please coordinate with the authors of these PRs to avoid merge conflicts.

@knst knst requested review from PastaPastaPasta and UdjinM6 July 1, 2026 07:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0fe8e0553b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

with Pool(8) as pool:
# Use fork so workers inherit the populated `deps` global without
# having to pickle it for every task.
with multiprocessing.get_context("fork").Pool(8) as pool:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid requiring the fork start method

When this devtool is run with a Windows Python or any other platform that lacks the fork start method, this line raises before any dependency checking runs, which also breaks test/lint/lint-circular-dependencies.py for those environments. The previous multiprocess.Pool path could serialize the nested closure under spawn, so this Python 3.15 fix regresses non-fork platforms; consider passing/initializing deps for workers instead of hard-coding fork.

Useful? React with 👍 / 👎.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 03342e94-4705-4e2c-a5bb-923c595ac9b9

📥 Commits

Reviewing files that changed from the base of the PR and between dfe1e5d and 0fe8e05.

📒 Files selected for processing (1)
  • contrib/devtools/circular-dependencies.py

Walkthrough

The script contrib/devtools/circular-dependencies.py was refactored to use Python's multiprocessing module instead of multiprocess, explicitly creating the worker pool with a "fork" context. The files and deps variables, along with the handle_module2 function, were moved from the main block to module scope so that forked worker processes inherit the populated deps mapping rather than requiring it to be pickled per task. The main block now only handles argument iteration and invocation of handle_module.

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

Related PRs: None identified.

Suggested labels: contrib, devtools, refactor

Suggested reviewers: None identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: fixing circular-dependencies on Python 3.15.
Description check ✅ Passed The description directly describes the Python 3.15 multiprocessing/pickling fix and matches the code changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

Small dev-tool fix replacing third-party multiprocess (broken on Python 3.15 due to dill/co_lnotab) with stdlib multiprocessing using an explicit fork context, hoisting handle_module2/files/deps to module scope. Behavior is preserved — the pool is recreated inside the outer loop, so each forked worker set inherits an up-to-date deps. Affects only contrib/devtools/circular-dependencies.py; no consensus or runtime code touched.

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.

2 participants