Update arcade new --full (#805)
Monorepo has new linting and formatting preferences. Updated the `--full` to reflect that. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: changes only affect the generated `--full` project template and CLI help surface (flag is now hidden), plus a patch version bump. > > **Overview** > Updates `arcade new --full` to be *internal-only* by hiding the flag and revises the full template to match monorepo conventions (Ruff/pre-commit versions and hook IDs, `.ruff.toml` now extends the repo config, `pyproject.toml` formatting/booleans, adds `pytest` `asyncio_mode`, and removes `pre-commit install` from the template `Makefile`). > > Adds a regression test ensuring generated full-template files match these conventions, and bumps the root package version to `1.12.2`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2c1a285752d67dc4dd1aa8e0b6f25ca2f0a33fa2. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This commit is contained in:
parent
78c8e6fb99
commit
bbba7aec90
7 changed files with 55 additions and 68 deletions
|
|
@ -229,9 +229,10 @@ def new(
|
||||||
debug: bool = typer.Option(False, "--debug", "-d", help="Show debug information"),
|
debug: bool = typer.Option(False, "--debug", "-d", help="Show debug information"),
|
||||||
full: bool = typer.Option(
|
full: bool = typer.Option(
|
||||||
False,
|
False,
|
||||||
"--full",
|
|
||||||
"-f",
|
"-f",
|
||||||
help="Create a starter MCP server (pyproject.toml, server.py, .env.example)",
|
"--full",
|
||||||
|
help="[Internal] Create a full toolkit scaffold for Arcade development.",
|
||||||
|
hidden=True,
|
||||||
),
|
),
|
||||||
) -> None:
|
) -> None:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
files: ^.*/{{toolkit_name}}/.*
|
files: ^.*/{{ toolkit_name }}/.*
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: "v4.4.0"
|
rev: 'v4.4.0'
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-case-conflict
|
- id: check-case-conflict
|
||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
|
|
@ -11,8 +11,8 @@ repos:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.6.7
|
rev: v0.15.7
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff-check
|
||||||
args: [--fix]
|
args: [--fix]
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1 @@
|
||||||
target-version = "py310"
|
extend = "../../../../ruff.toml"
|
||||||
line-length = 100
|
|
||||||
fix = true
|
|
||||||
|
|
||||||
[lint]
|
|
||||||
select = [
|
|
||||||
# flake8-2020
|
|
||||||
"YTT",
|
|
||||||
# flake8-bandit
|
|
||||||
"S",
|
|
||||||
# flake8-bugbear
|
|
||||||
"B",
|
|
||||||
# flake8-builtins
|
|
||||||
"A",
|
|
||||||
# flake8-comprehensions
|
|
||||||
"C4",
|
|
||||||
# flake8-debugger
|
|
||||||
"T10",
|
|
||||||
# flake8-simplify
|
|
||||||
"SIM",
|
|
||||||
# isort
|
|
||||||
"I",
|
|
||||||
# mccabe
|
|
||||||
"C90",
|
|
||||||
# pycodestyle
|
|
||||||
"E", "W",
|
|
||||||
# pyflakes
|
|
||||||
"F",
|
|
||||||
# pygrep-hooks
|
|
||||||
"PGH",
|
|
||||||
# pyupgrade
|
|
||||||
"UP",
|
|
||||||
# ruff
|
|
||||||
"RUF",
|
|
||||||
# tryceratops
|
|
||||||
"TRY",
|
|
||||||
]
|
|
||||||
|
|
||||||
[lint.per-file-ignores]
|
|
||||||
"*" = ["TRY003", "B904"]
|
|
||||||
"**/tests/*" = ["S101", "E501"]
|
|
||||||
"**/evals/*" = ["S101", "E501"]
|
|
||||||
|
|
||||||
[format]
|
|
||||||
preview = true
|
|
||||||
skip-magic-trailing-comma = false
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ help: ## Show this help message
|
||||||
|
|
||||||
install: ## Install dependencies, then overlay any ../.local-overrides
|
install: ## Install dependencies, then overlay any ../.local-overrides
|
||||||
uv sync --all-extras
|
uv sync --all-extras
|
||||||
uv run pre-commit install
|
|
||||||
@if [ -f ../.local-overrides ]; then \
|
@if [ -f ../.local-overrides ]; then \
|
||||||
while IFS= read -r pkg || [ -n "$$pkg" ]; do \
|
while IFS= read -r pkg || [ -n "$$pkg" ]; do \
|
||||||
case "$$pkg" in \#*|"") continue ;; esac; \
|
case "$$pkg" in \#*|"") continue ;; esac; \
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = [ "hatchling",]
|
requires = ["hatchling"]
|
||||||
build-backend = "hatchling.build"
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "{{ package_name }}"
|
name = "{{ package_name }}"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "{{ toolkit_description }}"
|
description = "{{ toolkit_description }}"
|
||||||
license = {text = "Proprietary - Arcade Software License Agreement v1.0"}
|
license = { text = "Proprietary - Arcade Software License Agreement v1.0" }
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arcade-mcp-server>={{ arcade_mcp_server_min_version }},<{{ arcade_mcp_server_max_version }}",
|
"arcade-mcp-server>={{ arcade_mcp_server_min_version }},<{{ arcade_mcp_server_max_version }}",
|
||||||
|
|
@ -31,26 +31,27 @@ dev = [
|
||||||
"mypy>=1.5.1,<1.6.0",
|
"mypy>=1.5.1,<1.6.0",
|
||||||
"pre-commit>=3.4.0,<3.5.0",
|
"pre-commit>=3.4.0,<3.5.0",
|
||||||
"tox>=4.11.1,<4.12.0",
|
"tox>=4.11.1,<4.12.0",
|
||||||
"ruff>=0.7.4,<0.8.0",
|
"ruff>=0.15.7,<0.16.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
files = [ "{{ package_name }}/**/*.py",]
|
files = ["{{ package_name }}/**/*.py"]
|
||||||
python_version = "3.10"
|
python_version = "3.10"
|
||||||
disallow_untyped_defs = "True"
|
disallow_untyped_defs = true
|
||||||
disallow_any_unimported = "True"
|
disallow_any_unimported = true
|
||||||
no_implicit_optional = "True"
|
no_implicit_optional = true
|
||||||
check_untyped_defs = "True"
|
check_untyped_defs = true
|
||||||
warn_return_any = "True"
|
warn_return_any = true
|
||||||
warn_unused_ignores = "True"
|
warn_unused_ignores = true
|
||||||
show_error_codes = "True"
|
show_error_codes = true
|
||||||
ignore_missing_imports = "True"
|
ignore_missing_imports = true
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
testpaths = [ "tests",]
|
testpaths = ["tests"]
|
||||||
|
asyncio_mode = "auto"
|
||||||
|
|
||||||
[tool.coverage.report]
|
[tool.coverage.report]
|
||||||
skip_empty = true
|
skip_empty = true
|
||||||
|
|
||||||
[tool.hatch.build.targets.wheel]
|
[tool.hatch.build.targets.wheel]
|
||||||
packages = [ "{{ package_name }}",]
|
packages = ["{{ package_name }}"]
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,37 @@ def test_create_new_toolkit_prints_next_steps(tmp_path: Path) -> None:
|
||||||
assert "my_server" in output
|
assert "my_server" in output
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_new_toolkit_full_template_matches_monorepo(tmp_path: Path) -> None:
|
||||||
|
"""Full template should produce files matching monorepo conventions."""
|
||||||
|
output_dir = tmp_path / "full_conventions"
|
||||||
|
output_dir.mkdir()
|
||||||
|
|
||||||
|
buf = StringIO()
|
||||||
|
test_console = Console(file=buf, force_terminal=False)
|
||||||
|
import arcade_cli.new as new_mod
|
||||||
|
|
||||||
|
orig = new_mod.console
|
||||||
|
new_mod.console = test_console
|
||||||
|
try:
|
||||||
|
create_new_toolkit(str(output_dir), "my_server")
|
||||||
|
finally:
|
||||||
|
new_mod.console = orig
|
||||||
|
|
||||||
|
toolkit_dir = output_dir / "my_server"
|
||||||
|
|
||||||
|
# pyproject.toml formatting checks
|
||||||
|
pyproject = (toolkit_dir / "pyproject.toml").read_text()
|
||||||
|
assert 'requires = ["hatchling"]' in pyproject
|
||||||
|
assert 'license = { text = "Proprietary' in pyproject
|
||||||
|
assert 'asyncio_mode = "auto"' in pyproject
|
||||||
|
assert "disallow_untyped_defs = true" in pyproject
|
||||||
|
assert '"True"' not in pyproject
|
||||||
|
|
||||||
|
# Makefile should not have pre-commit install
|
||||||
|
makefile = (toolkit_dir / "Makefile").read_text()
|
||||||
|
assert "pre-commit install" not in makefile
|
||||||
|
|
||||||
|
|
||||||
def test_create_new_toolkit_minimal_with_spaces(tmp_path: Path) -> None:
|
def test_create_new_toolkit_minimal_with_spaces(tmp_path: Path) -> None:
|
||||||
output_dir = tmp_path / "dir with spaces"
|
output_dir = tmp_path / "dir with spaces"
|
||||||
output_dir.mkdir()
|
output_dir.mkdir()
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "arcade-mcp"
|
name = "arcade-mcp"
|
||||||
version = "1.12.1"
|
version = "1.12.2"
|
||||||
description = "Arcade.dev - Tool Calling platform for Agents"
|
description = "Arcade.dev - Tool Calling platform for Agents"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = { file = "LICENSE" }
|
license = { file = "LICENSE" }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue