Update arcade new (#520)
This PR updates the `arcade new` CLI command. * adds support for official arcade tools. * removes local libs sources for toolkits that are not a community or official * Stopped creating README for community toolkits
This commit is contained in:
parent
c97f2f7500
commit
288ff61959
5 changed files with 86 additions and 6 deletions
|
|
@ -75,7 +75,9 @@ def write_template(path: Path, content: str) -> None:
|
|||
path.write_text(content, encoding="utf-8")
|
||||
|
||||
|
||||
def create_ignore_pattern(include_evals: bool, community_toolkit: bool) -> re.Pattern[str]:
|
||||
def create_ignore_pattern(
|
||||
include_evals: bool, is_community_or_official_toolkit: bool
|
||||
) -> re.Pattern[str]:
|
||||
"""Create an ignore pattern based on user preferences."""
|
||||
patterns = [
|
||||
"__pycache__",
|
||||
|
|
@ -96,8 +98,10 @@ def create_ignore_pattern(include_evals: bool, community_toolkit: bool) -> re.Pa
|
|||
if not include_evals:
|
||||
patterns.append("evals")
|
||||
|
||||
if not community_toolkit:
|
||||
patterns.extend([".ruff.toml", ".pre-commit-config.yaml", "README.md"])
|
||||
if not is_community_or_official_toolkit:
|
||||
patterns.extend([".ruff.toml", ".pre-commit-config.yaml", "LICENSE"])
|
||||
else:
|
||||
patterns.extend(["README.md"])
|
||||
|
||||
return re.compile(f"({'|'.join(patterns)})$")
|
||||
|
||||
|
|
@ -182,7 +186,9 @@ def create_new_toolkit(output_directory: str, toolkit_name: str) -> None:
|
|||
"Is your toolkit a community contribution (to be merged into "
|
||||
"\x1b]8;;https://github.com/ArcadeAI/arcade-ai\x1b\\ArcadeAI/arcade-ai\x1b]8;;\x1b\\ repo)?"
|
||||
)
|
||||
is_community_toolkit = ask_yes_no_question(prompt, default=False)
|
||||
is_community_toolkit = ask_yes_no_question(prompt, default=True)
|
||||
|
||||
is_official_toolkit = cwd.name == "toolkits" and cwd.parent.name == "tools"
|
||||
|
||||
context = {
|
||||
"package_name": "arcade_" + toolkit_name if is_community_toolkit else toolkit_name,
|
||||
|
|
@ -198,6 +204,7 @@ def create_new_toolkit(output_directory: str, toolkit_name: str) -> None:
|
|||
"arcade_ai_max_version": ARCADE_AI_MAX_VERSION,
|
||||
"creation_year": datetime.now().year,
|
||||
"is_community_toolkit": is_community_toolkit,
|
||||
"is_official_toolkit": is_official_toolkit,
|
||||
}
|
||||
template_directory = Path(__file__).parent / "templates" / "{{ toolkit_name }}"
|
||||
|
||||
|
|
@ -207,7 +214,9 @@ def create_new_toolkit(output_directory: str, toolkit_name: str) -> None:
|
|||
)
|
||||
|
||||
# Create dynamic ignore pattern based on user preferences
|
||||
ignore_pattern = create_ignore_pattern(include_evals, is_community_toolkit)
|
||||
ignore_pattern = create_ignore_pattern(
|
||||
include_evals, is_community_toolkit or is_official_toolkit
|
||||
)
|
||||
|
||||
try:
|
||||
create_package(env, template_directory, toolkit_directory, context, ignore_pattern)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
{% if is_official_toolkit -%}
|
||||
# The Arcade Software License Agreement
|
||||
|
||||
- Version 1.0
|
||||
- Effective Date: July 24, 2025
|
||||
|
||||
---
|
||||
|
||||
This software and associated documentation (collectively, the “Software”) are the intellectual property of Arcade Technologies, Inc. (“Arcade”). All rights are reserved.
|
||||
|
||||
1. License Grant
|
||||
|
||||
No license or other rights are granted to any party under this Agreement, whether by implication, estoppel, or otherwise. This Software is proprietary and confidential. Use, reproduction, modification, distribution, display, or creation of derivative works based on the Software is strictly prohibited without the prior written consent of Arcade.
|
||||
|
||||
2. Commercial Use Only
|
||||
|
||||
Any use of this Software requires a commercial license agreement with Arcade. You may not use any part of the Software for any purpose—including but not limited to evaluation, testing, or internal use—without first obtaining explicit written permission and entering into a commercial licensing arrangement.
|
||||
|
||||
To inquire about licensing terms, contact Arcade at:
|
||||
🔗 www.arcade.dev
|
||||
|
||||
3. No Open Source Rights
|
||||
|
||||
This Software is not licensed under an open-source license. No part of it may be incorporated into open-source or publicly available projects under any open-source terms or licenses.
|
||||
|
||||
4. Ownership
|
||||
|
||||
Arcade retains all right, title, and interest in and to the Software, including all intellectual property rights therein. No ownership or license rights are transferred under this Agreement.
|
||||
|
||||
5. Disclaimer of Warranty
|
||||
|
||||
The Software is provided “as is” without warranty of any kind. Arcade disclaims all warranties, express or implied, including but not limited to warranties of merchantability, fitness for a particular purpose, and noninfringement.
|
||||
|
||||
6. Limitation of Liability
|
||||
|
||||
In no event shall Arcade be liable for any damages arising out of or in connection with the use or performance of the Software, whether in an action of contract, tort (including negligence), or otherwise.
|
||||
{% endif -%}
|
||||
{% if is_community_toolkit -%}
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025, Arcade AI
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
{% endif -%}
|
||||
|
|
@ -11,12 +11,14 @@ install: ## Install the uv environment and install all packages with dependencie
|
|||
@if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi
|
||||
@echo "✅ All packages and dependencies installed via uv"
|
||||
|
||||
{% if is_community_toolkit or is_official_toolkit -%}
|
||||
.PHONY: install-local
|
||||
install-local: ## Install the uv environment and install all packages with dependencies with local Arcade sources
|
||||
@echo "🚀 Creating virtual environment and installing all packages using uv"
|
||||
@uv sync --active --all-extras
|
||||
@if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi
|
||||
@echo "✅ All packages and dependencies installed via uv"
|
||||
{% endif -%}
|
||||
|
||||
.PHONY: build
|
||||
build: clean-build ## Build wheel file using poetry
|
||||
|
|
|
|||
|
|
@ -40,11 +40,20 @@ dev = [
|
|||
[project.entry-points.arcade_toolkits]
|
||||
toolkit_name = "{{ package_name }}"
|
||||
|
||||
{% if is_community_toolkit -%}
|
||||
# Use local path sources for arcade libs when working locally
|
||||
[tool.uv.sources]
|
||||
arcade-ai = { path = "../../", editable = true }
|
||||
arcade-serve = { path = "../../libs/arcade-serve/", editable = true }
|
||||
arcade-tdk = { path = "../../libs/arcade-tdk/", editable = true }
|
||||
{% endif -%}
|
||||
{% if is_official_toolkit -%}
|
||||
# Use local path sources for arcade libs when working locally
|
||||
[tool.uv.sources]
|
||||
arcade-ai = { path = "../../../arcade-ai", editable = true }
|
||||
arcade-serve = { path = "../../../arcade-ai/libs/arcade-serve/", editable = true }
|
||||
arcade-tdk = { path = "../../../arcade-ai/libs/arcade-tdk/", editable = true }
|
||||
{% endif -%}
|
||||
|
||||
[tool.mypy]
|
||||
files = [ "{{ package_name }}/**/*.py",]
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "arcade-ai"
|
||||
version = "2.1.2"
|
||||
version = "2.1.3"
|
||||
description = "Arcade.dev - Tool Calling platform for Agents"
|
||||
readme = "README.md"
|
||||
license = {file = "LICENSE"}
|
||||
|
|
|
|||
Loading…
Reference in a new issue