Skip to content

feat: Integrate PyCrucible#370

Open
MH0386 wants to merge 89 commits into
mainfrom
pycrucible
Open

feat: Integrate PyCrucible#370
MH0386 wants to merge 89 commits into
mainfrom
pycrucible

Conversation

@MH0386

@MH0386 MH0386 commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Integrate PyCrucible by adding it as a development dependency and providing a default configuration file for its usage.

New Features:

  • Add pycrucible>=0.3.0 to the development dependencies
  • Introduce pycrucible.toml configuration file with entrypoint, package patterns, and source repository settings

Copilot AI review requested due to automatic review settings October 31, 2025 16:40
@gitnotebooks

gitnotebooks Bot commented Oct 31, 2025

Copy link
Copy Markdown

@sourcery-ai

sourcery-ai Bot commented Oct 31, 2025

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

Reviewer's Guide

This PR integrates the pycrucible tool into the project by adding it as a development dependency and introducing a pycrucible.toml configuration file to specify entrypoint, packaging patterns, and source update strategy.

File-Level Changes

Change Details Files
Add pycrucible to development dependencies
  • Inserted "pycrucible>=0.3.0" into dependency-groups.dev
pyproject.toml
Introduce pycrucible.toml configuration
  • Created pycrucible.toml
  • Specified entrypoint
  • Defined include/exclude file patterns
  • Configured source repository, branch, and update strategy
pycrucible.toml

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 Oct 31, 2025

Copy link
Copy Markdown
Contributor

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

Summary by CodeRabbit

  • Chores
    • Updated project build configuration files
    • Added new development tooling dependency
    • Enhanced CI/CD workflow automation
    • Modified repository file tracking settings

Walkthrough

Adds PyCrucible config and a CI action step, registers test.http in source control (removed from ignore), adds pycrucible as a dev dependency, and ignores pycrucible_payload/.

Changes

Cohort / File(s) Summary
Gitignore updates
.gitignore
Removed test.http from ignore (now tracked); added pycrucible_payload/ to ignore.
PyCrucible configuration
pycrucible.toml
New file: sets entrypoint ./src/visualizr/__main__.py, package include/exclude patterns, and source repo https://github.com/AlphaSphereDotAI/visualizr on branch main with update_strategy = "pull".
Project dependencies
pyproject.toml
Added dev dependency pycrucible>=0.3.0 under [dependency-groups].dev.
CI workflow change
.github/workflows/build.yaml
Added "Build Python App with PyCrucible" step using razorblade23/pycrucible-action@v2 to the setup_and_build job after the source/wheel build step; no artifact upload included.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GH as GitHub Actions
  participant Repo as Repository
  participant Job as setup_and_build
  participant PyC as PyCrucible Action

  GH->>Repo: push / workflow trigger
  GH->>Job: start setup_and_build
  Job->>Repo: checkout code
  Job->>Job: build source & wheel
  Job->>PyC: run "Build Python App with PyCrucible" (razorblade23/pycrucible-action@v2)
  PyC->>Job: read `pycrucible.toml` and run PyCrucible build
  Note right of Job: no artifact upload step present
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify pycrucible.toml entrypoint and include/exclude patterns.
  • Confirm pyproject.toml dev dependency and version constraint.
  • Validate workflow step placement, permissions, and whether artifact upload or caching is needed.
  • Ensure making test.http tracked is intentional.

Poem

🐰 I hopped through lines of code tonight,
A tiny config tucked just right.
test.http steps into the light,
PyCrucible hums and builds with cheer,
CI carrots gleam — the release is near.

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: Integrate PyCrucible' directly and clearly summarizes the main objective of the changeset—integrating PyCrucible as a development tool.
Description check ✅ Passed The description is directly related to the changeset, explaining the addition of PyCrucible as a development dependency and the configuration file, which aligns with all file changes in the PR.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pycrucible

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.

@deepsource-io

deepsource-io Bot commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

Here's the code health analysis summary for commits f76c860..3cae4ea. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ SuccessView Check ↗
DeepSource Docker LogoDocker✅ SuccessView Check ↗
DeepSource Secrets LogoSecrets✅ SuccessView Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @MH0386, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates pycrucible into the project's development environment by adding it as a development dependency and providing its initial configuration. This setup facilitates the use of pycrucible for potential code analysis, security scanning, or other development-related processes, while also ensuring that generated or configuration-specific files are properly ignored by version control.

Highlights

  • Pycrucible Dependency Added: The pycrucible package, version 0.3.0, has been introduced as a development dependency. This change is reflected in pyproject.toml and its lock file, uv.lock.
  • Pycrucible Configuration: A new configuration file, pycrucible.toml, has been added. It defines the project's entrypoint, specifies file inclusion and exclusion patterns for pycrucible to analyze, and sets the source repository details.
  • Gitignore Updates: The .gitignore file has been updated to exclude pycrucible_payload/ and several other tool-specific rule files, ensuring these generated or configuration-related files are not tracked by Git.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@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 there - I've reviewed your changes - here's some feedback:

  • Double-check that the entrypoint path in pycrucible.toml correctly matches your package layout—consider using the module path (e.g. visualizr:main) instead of a direct file reference.
  • Your include/exclude patterns might miss common build artifacts (e.g. dist/, build/, .pytest_cache/), so consider adding those to the exclude list.
  • Review whether it’s necessary to explicitly include pyproject.toml and README.md in patterns or if those can be handled by default by the repository source control.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Double-check that the entrypoint path in pycrucible.toml correctly matches your package layout—consider using the module path (e.g. `visualizr:main`) instead of a direct file reference.
- Your include/exclude patterns might miss common build artifacts (e.g. `dist/`, `build/`, `.pytest_cache/`), so consider adding those to the exclude list.
- Review whether it’s necessary to explicitly include `pyproject.toml` and `README.md` in patterns or if those can be handled by default by the repository source control.

## Individual Comments

### Comment 1
<location> `pycrucible.toml:5-13` </location>
<code_context>
+entrypoint = "./src/visualizr/__main__.py"
+
+[package.patterns]
+patterns.include = ["**/*.py", "**/README.md", "**/pyproject.toml"]
+patterns.exclude = [
+    "**/*.pyc",
</code_context>

<issue_to_address>
**suggestion:** Review exclude patterns for completeness and potential edge cases.

Consider adding patterns for other generated files or directories such as build/, dist/, or .mypy_cache/ if relevant to your workflow.

```suggestion
patterns.exclude = [
    "**/*.pyc",
    "**/*.pyd",
    "**/*.pyo",
    "**/.trunk/**/*",
    "**/__pycache__/**",
    ".git/**/*",
    ".venv/**/*",
    "build/**/*",
    "dist/**/*",
    ".mypy_cache/**/*",
    ".pytest_cache/**/*",
    ".coverage",
]
```
</issue_to_address>

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 pycrucible.toml
Comment on lines +5 to +13
patterns.exclude = [
"**/*.pyc",
"**/*.pyd",
"**/*.pyo",
"**/.trunk/**/*",
"**/__pycache__/**",
".git/**/*",
".venv/**/*",
]

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.

suggestion: Review exclude patterns for completeness and potential edge cases.

Consider adding patterns for other generated files or directories such as build/, dist/, or .mypy_cache/ if relevant to your workflow.

Suggested change
patterns.exclude = [
"**/*.pyc",
"**/*.pyd",
"**/*.pyo",
"**/.trunk/**/*",
"**/__pycache__/**",
".git/**/*",
".venv/**/*",
]
patterns.exclude = [
"**/*.pyc",
"**/*.pyd",
"**/*.pyo",
"**/.trunk/**/*",
"**/__pycache__/**",
".git/**/*",
".venv/**/*",
"build/**/*",
"dist/**/*",
".mypy_cache/**/*",
".pytest_cache/**/*",
".coverage",
]

@mergify mergify Bot temporarily deployed to code_quality October 31, 2025 16:40 Inactive

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request successfully adds pycrucible as a development dependency and introduces its configuration file. The changes to pyproject.toml and the lock file are correct. However, the new pycrucible.toml configuration file contains a syntax issue in how the package patterns are defined, which will likely prevent the tool from functioning as intended. I've provided a specific comment with a suggested fix for this.

Comment thread pycrucible.toml
Comment on lines +4 to +13
patterns.include = ["**/*.py", "**/README.md", "**/pyproject.toml"]
patterns.exclude = [
"**/*.pyc",
"**/*.pyd",
"**/*.pyo",
"**/.trunk/**/*",
"**/__pycache__/**",
".git/**/*",
".venv/**/*",
]

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.

high

The keys patterns.include and patterns.exclude appear to be incorrect. Within the [package.patterns] table, using dotted keys like this creates a nested table [package.patterns.patterns]. It's very likely that the intended keys are include and exclude directly under [package.patterns] for the configuration to be parsed correctly by pycrucible.

Suggested change
patterns.include = ["**/*.py", "**/README.md", "**/pyproject.toml"]
patterns.exclude = [
"**/*.pyc",
"**/*.pyd",
"**/*.pyo",
"**/.trunk/**/*",
"**/__pycache__/**",
".git/**/*",
".venv/**/*",
]
include = ["**/*.py", "**/README.md", "**/pyproject.toml"]
exclude = [
"**/*.pyc",
"**/*.pyd",
"**/*.pyo",
"**/.trunk/**/*",
"**/__pycache__/**",
".git/**/*",
".venv/**/*",
]

Copilot AI 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.

Pull Request Overview

This PR adds the pycrucible tool as a development dependency and creates its configuration file. The purpose is to integrate pycrucible for managing code sharing and synchronization with the project repository.

Key changes:

  • Added pycrucible>=0.3.0 as a dev dependency
  • Created pycrucible.toml configuration file with entrypoint, package patterns, and source repository settings
  • Updated .gitignore to exclude pycrucible-related files and various IDE-specific rules files

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
pyproject.toml Added pycrucible as a development dependency
uv.lock Lock file updated with pycrucible package metadata and wheels
pycrucible.toml New configuration file defining entrypoint, included/excluded patterns, and source repository
.gitignore Added exclusions for pycrucible payload directory and IDE-specific rules files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pycrucible.toml
Comment on lines +4 to +5
patterns.include = ["**/*.py", "**/README.md", "**/pyproject.toml"]
patterns.exclude = [

Copilot AI Oct 31, 2025

Copy link

Choose a reason for hiding this comment

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

The TOML structure '[package.patterns]' followed by 'patterns.include' creates a redundant nested structure. This should either be '[package.patterns.include]' and '[package.patterns.exclude]' as separate sections, or the 'patterns.' prefix should be removed from the keys. The current structure creates 'package.patterns.patterns.include' which is likely not the intended configuration path.

Suggested change
patterns.include = ["**/*.py", "**/README.md", "**/pyproject.toml"]
patterns.exclude = [
include = ["**/*.py", "**/README.md", "**/pyproject.toml"]
exclude = [

Copilot uses AI. Check for mistakes.
@mergify

mergify Bot commented Oct 31, 2025

Copy link
Copy Markdown
Contributor

🧪 CI Insights

Here's what we observed from your CI run for 3cae4ea.

🟢 All jobs passed!

But CI Insights is watching 👀

@mergify mergify Bot temporarily deployed to code_quality October 31, 2025 16:44 Inactive

@coderabbitai coderabbitai 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.

Actionable comments posted: 0

♻️ Duplicate comments (1)
pycrucible.toml (1)

4-5: Fix TOML syntax: incorrect nested key structure.

Lines 4–5 use dotted keys (patterns.include and patterns.exclude), which in TOML create a nested table [package.patterns.patterns] instead of direct keys under [package.patterns]. This breaks pycrucible's configuration parsing. This issue was previously flagged and remains unresolved.

Apply this diff to fix the syntax:

 [package.patterns]
-patterns.include = ["**/*.py", "**/README.md", "**/pyproject.toml"]
-patterns.exclude = [
+include = ["**/*.py", "**/README.md", "**/pyproject.toml"]
+exclude = [
     "**/*.pyc",
     "**/*.pyd",
     "**/*.pyo",
     "**/.trunk/**/*",
     "**/__pycache__/**",
-    ".git/**/*",
+    ".git/**/*",
     ".venv/**/*",
 ]
🧹 Nitpick comments (1)
pycrucible.toml (1)

5-13: Consider expanding exclude patterns for completeness.

The exclude list covers common Python build artifacts but omits directories found in .gitignore like build/, dist/, .mypy_cache/, and .pytest_cache/. Including these would prevent pycrucible from processing generated or cached files that should not be part of the package analysis.

Consider expanding the exclude patterns:

 exclude = [
     "**/*.pyc",
     "**/*.pyd",
     "**/*.pyo",
     "**/.trunk/**/*",
     "**/__pycache__/**",
     ".git/**/*",
     ".venv/**/*",
+    "build/**/*",
+    "dist/**/*",
+    ".mypy_cache/**/*",
+    ".pytest_cache/**/*",
+    ".coverage",
 ]
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51236d1 and 21e5d0b.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .gitignore (1 hunks)
  • pycrucible.toml (1 hunks)
  • pyproject.toml (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: Check Dependency Compatibility
  • GitHub Check: Sourcery review
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
🔇 Additional comments (3)
pyproject.toml (1)

64-64: Dependency addition looks good.

The pycrucible>=0.3.0 dependency is properly placed in the dev group and uses a reasonable version constraint.

.gitignore (1)

15-24: Repository metadata updates are sensible.

Moving test.http to tracked status, ignoring AI tool configurations, and excluding the pycrucible payload directory align well with the PR objectives and standard development practices.

pycrucible.toml (1)

1-1: Entrypoint path verified as valid.

The file ./src/visualizr/__main__.py exists and contains a properly structured entry point with a main() function that launches the Gradio application via if __name__ == "__main__":. The configuration is correct.

@mergify

mergify Bot commented Nov 1, 2025

Copy link
Copy Markdown
Contributor

Hi @MH0386, Your PR is in conflict and cannot be merged.

@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.

New security issues found

Comment thread .github/workflows/build.yaml Outdated

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21e5d0b and aedc50a.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml (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). (3)
  • GitHub Check: Sourcery review
  • GitHub Check: Mergify Merge Protections
  • GitHub Check: Summary
🔇 Additional comments (1)
.github/workflows/build.yaml (1)

49-66: Clarify job dependency and artifact handling.

The build_binary job depends on setup_and_build but doesn't download the dist/ artifacts produced by that job. Additionally, it repeats the checkout and uv setup steps. Please clarify:

  1. Is the dependency on setup_and_build necessary, or should this job run independently?
  2. What artifacts or outputs should the PyCrucible build produce, and how should they be handled (uploaded, committed, etc.)?

Without artifact handling, it's unclear how the binary distribution integrates with the release workflow.

Comment thread .github/workflows/build.yaml Outdated
@MH0386 MH0386 changed the title feat: add pycrucible dependency and create pycrucible.toml configuration feat: Integrate PyCrucible Nov 1, 2025

@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.

✅ All blocking comments have been addressed

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

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