feat: add robyn-config as optional dependencies#1387
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughDeclares robyn-config as an optional dependency, documents its CLI and install options, and adds integration tests that validate CLI availability, project scaffolding, adminpanel creation, and monitoring scaffolding. ChangesRobyn Config CLI Plugin
Sequence Diagram(s)sequenceDiagram
participant TestRunner
participant CLI as robyn-config
participant FS as Filesystem
TestRunner->>CLI: --help / create --help / add --help
CLI-->>TestRunner: exit 0, usage
TestRunner->>FS: create temp dir
TestRunner->>CLI: create scaffold (design, orm)
CLI-->>FS: generate pyproject.toml, src/, Makefile
TestRunner->>CLI: adminpanel, monitoring commands
CLI-->>FS: generate adminpanel dir, docker-compose.monitoring.yml, compose/monitoring/*
TestRunner->>FS: assert files exist and cleanup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
pyproject.toml (2)
78-88:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winAdd
robyn-configto Poetry dependencies.The PEP 621
[project.optional-dependencies]section includesrobyn-config, but the corresponding Poetry[tool.poetry.dependencies]section does not declare it as an optional dependency. This creates an inconsistency between installation methods.🔧 Proposed fix
[tool.poetry.dependencies] python = "^3.10" inquirerpy = "0.3.4" maturin = "1.7.4" watchdog = "^6.0.0" multiprocess = "^0.70.18" uvloop = { version = "0.22.1", markers = "sys_platform != 'win32' and (sys_platform != 'cygwin' and platform_python_implementation != 'PyPy')" } jinja2 = { version = "^3.1.6", optional = true } pydantic = { version = "^2.0.0", optional = true } +robyn-config = { version = "^1.0.0", optional = true } rustimport = "^1.3.4" orjson = "^3.11.5"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pyproject.toml` around lines 78 - 88, The pyproject.toml is inconsistent: the PEP 621 [project.optional-dependencies] lists robyn-config but [tool.poetry.dependencies] does not declare it as optional; add an entry for robyn-config under [tool.poetry.dependencies] (e.g. robyn-config = { version = "<same-version-as-in-[project.optional-dependencies]>", optional = true }) so Poetry knows it is an optional dependency and the versions match between the two sections.
90-93:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winUpdate Poetry extras to include
robyn-config.The PEP 621
[project.optional-dependencies]section's"all"extra includesrobyn-config(line 41), but the Poetry[tool.poetry.extras]section does not. Users installing viapip install robyn[all]will getrobyn-config, while those using Poetry with theallextra will not.🔧 Proposed fix
[tool.poetry.extras] templating = ["jinja2"] pydantic = ["pydantic"] -all = ["jinja2", "pydantic"] +robyn-config = ["robyn-config"] +all = ["jinja2", "pydantic", "robyn-config"]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pyproject.toml` around lines 90 - 93, The Poetry extras block ([tool.poetry.extras]) is missing the robyn-config package in the "all" extra; update the "all" list to include "robyn-config" and optionally add a dedicated extra key "robyn-config" = ["robyn-config"] so Poetry users get the same optional dependency set as the PEP 621 [project.optional-dependencies] configuration; edit the existing keys templating, pydantic and all to include the robyn-config entry (e.g., add "robyn-config" to the all array and add a new robyn-config extra if you want a named extra).
🧹 Nitpick comments (2)
integration_tests/test_robyn_config.py (2)
52-70: ⚖️ Poor tradeoffConsider parameterizing the
scaffolded_projectfixture.The
scaffolded_projectfixture always creates a DDD project with SQLAlchemy (line 64), which means the adminpanel and monitoring tests only validate one configuration. Consider making this fixture parameterized or creating separate fixtures for different design patterns to ensure broader test coverage.This is especially relevant since
test_create_project_scaffoldtests all design×ORM combinations (lines 72-89), but subsequent tests don't.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@integration_tests/test_robyn_config.py` around lines 52 - 70, The scaffolded_project fixture is hard-coded to ("ddd","sqlalchemy"); change it to be parameterized so tests run against multiple design×ORM combos: convert scaffolded_project to accept a pytest request (or use `@pytest.fixture`(params=[("ddd","sqlalchemy"), ("layered","tortoise"), ...])) and build the subprocess.run args from request.param (e.g., design, orm) when invoking "robyn-config create"; alternatively add distinct fixtures (e.g., scaffolded_project_ddd_sqlalchemy, scaffolded_project_layered_tortoise) that run subprocess.run with the desired design/orm combinations and update tests that use scaffolded_project to either use the parametrized fixture or the new named fixtures.
91-116: ⚖️ Poor tradeoffAdd adminpanel tests for MVC design pattern.
The
scaffolded_projectfixture hardcodes--design ddd(line 64), so the adminpanel tests (lines 102, 115) never validate MVC projects. Since MVC is a documented design pattern (as shown intest_create_project_scaffoldat line 72), consider parameterizing the adminpanel tests to cover both design patterns, or document why only DDD is tested.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@integration_tests/test_robyn_config.py` around lines 91 - 116, The adminpanel tests (test_adminpanel_scaffolding and test_adminpanel_with_custom_credentials) only exercise the scaffolded_project fixture which currently hardcodes "--design ddd", so they never validate MVC projects; update the tests to cover both designs by either parameterizing these two tests with pytest.mark.parametrize over designs ["ddd","mvc"] and invoking the scaffold creation with the design parameter, or modify/extend the scaffolded_project fixture to accept a design argument (or add a separate mvc_scaffolded_project fixture) and run the same assertions for both designs; refer to scaffolded_project, test_adminpanel_scaffolding, test_adminpanel_with_custom_credentials and test_create_project_scaffold to implement the parameterization or fixture change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs_src/src/pages/documentation/en/plugins.mdx`:
- Around line 48-60: Update the CLI examples to match the actual robyn-config
signatures: for the create example include the required destination directory
argument (use the form "robyn-config create my_project destination_dir --design
ddd --orm sqlalchemy"), and ensure the other commands include the target project
directory argument as required by the implementation—i.e., change "robyn-config
add users", "robyn-config adminpanel", and "robyn-config monitoring" to include
the project directory parameter (e.g., "robyn-config add users <project_dir>",
"robyn-config adminpanel <project_dir>", "robyn-config monitoring
<project_dir>") so the examples align with the robyn-config
create/adminpanel/monitoring/add command signatures.
In `@integration_tests/test_robyn_config.py`:
- Around line 74-89: The test test_create_project_scaffold assumes the
robyn-config CLI supports a positional target directory (it calls subprocess.run
with ["robyn-config", "create", project_name, temp_dir, "--design", design,
"--orm", orm]) and expects created files directly in temp_dir; confirm whether
the CLI command handler for "create" accepts a second positional argument for
destination and whether implementation places files in destination vs
destination/project_name; if the CLI does not accept that positional arg or
places files under destination/project_name, either update the CLI handler to
accept and write into the provided directory or change the test to call the
documented signature (e.g., ["robyn-config", "create", project_name, "--design",
design, "--orm", orm]) and assert files exist under temp_dir/project_name, and
update docs_src/src/pages/documentation/en/plugins.mdx to match the chosen
behavior.
---
Outside diff comments:
In `@pyproject.toml`:
- Around line 78-88: The pyproject.toml is inconsistent: the PEP 621
[project.optional-dependencies] lists robyn-config but
[tool.poetry.dependencies] does not declare it as optional; add an entry for
robyn-config under [tool.poetry.dependencies] (e.g. robyn-config = { version =
"<same-version-as-in-[project.optional-dependencies]>", optional = true }) so
Poetry knows it is an optional dependency and the versions match between the two
sections.
- Around line 90-93: The Poetry extras block ([tool.poetry.extras]) is missing
the robyn-config package in the "all" extra; update the "all" list to include
"robyn-config" and optionally add a dedicated extra key "robyn-config" =
["robyn-config"] so Poetry users get the same optional dependency set as the PEP
621 [project.optional-dependencies] configuration; edit the existing keys
templating, pydantic and all to include the robyn-config entry (e.g., add
"robyn-config" to the all array and add a new robyn-config extra if you want a
named extra).
---
Nitpick comments:
In `@integration_tests/test_robyn_config.py`:
- Around line 52-70: The scaffolded_project fixture is hard-coded to
("ddd","sqlalchemy"); change it to be parameterized so tests run against
multiple design×ORM combos: convert scaffolded_project to accept a pytest
request (or use `@pytest.fixture`(params=[("ddd","sqlalchemy"),
("layered","tortoise"), ...])) and build the subprocess.run args from
request.param (e.g., design, orm) when invoking "robyn-config create";
alternatively add distinct fixtures (e.g., scaffolded_project_ddd_sqlalchemy,
scaffolded_project_layered_tortoise) that run subprocess.run with the desired
design/orm combinations and update tests that use scaffolded_project to either
use the parametrized fixture or the new named fixtures.
- Around line 91-116: The adminpanel tests (test_adminpanel_scaffolding and
test_adminpanel_with_custom_credentials) only exercise the scaffolded_project
fixture which currently hardcodes "--design ddd", so they never validate MVC
projects; update the tests to cover both designs by either parameterizing these
two tests with pytest.mark.parametrize over designs ["ddd","mvc"] and invoking
the scaffold creation with the design parameter, or modify/extend the
scaffolded_project fixture to accept a design argument (or add a separate
mvc_scaffolded_project fixture) and run the same assertions for both designs;
refer to scaffolded_project, test_adminpanel_scaffolding,
test_adminpanel_with_custom_credentials and test_create_project_scaffold to
implement the parameterization or fixture change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 58b15882-1243-4fb2-950c-d57ce7e70451
📒 Files selected for processing (4)
docs_src/src/pages/documentation/en/api_reference/index.mdxdocs_src/src/pages/documentation/en/plugins.mdxintegration_tests/test_robyn_config.pypyproject.toml
86435aa to
d9a0fab
Compare
30b359d to
621be80
Compare
Description
This PR adds
robyn-configas an optional dependency to the Robyn framework, along with documentation and integration tests.Summary
robyn-config >= 1.0.0, < 2.0.0as an optional dependency group inpyproject.tomlrobyn-configin the"all"extras grouprobyn-configin the plugins page (docs/en/plugins.mdx) with both standalone (pip install robyn-config) and optional dependency (pip install robyn[robyn-config]) installation methodsdocs/en/api_reference/index.mdx) to list all available optional dependencies:robyn[templating],robyn[pydantic],robyn[robyn-config], androbyn[all]PR Checklist
Please ensure that:
Pre-Commit Instructions:
Summary by CodeRabbit
Documentation
Tests
Chores