## Summary This PR removes the requirement that all toolkits must have the arcade_ prefix and introduces a more flexible toolkit discovery system using Python entry points. ### 🏷️ Flexible Toolkit Naming * Community toolkits: Only add arcade_ prefix when the user is in arcade-ai/toolkits/ directory and explicitly chooses to create a community contribution. * External toolkits: No prefix requirement - developers can name their toolkits however they want * Toolkit names are now determined by user choice rather than enforced automatically ### 🔍 Entry Point Discovery * Added find_arcade_toolkits_from_entrypoints() method to discover toolkits via entry points * Entry point group: arcade_toolkits with name: toolkit_name * Updated pyproject.toml template to include entry point configuration * Entry point discovery takes precedence over prefix-based discovery for deduplication ### 📦 Backward Compatibility * Existing arcade_* prefixed toolkits continue to work via find_arcade_toolkits_from_prefix() find_all_arcade_toolkits() now combines both discovery methods * Deduplication logic prefers entry point toolkits over prefix-based ones when package names match ### 🛠️ `arcade new` Template Updates * pyproject.toml template for `arcade new` now includes entry point configuration: [project.entry-points.arcade_toolkits] ### 🔧 Minor Improvements * Refactored _strip_arcade_prefix() into a separate method for reusability * Updated variable naming for clarity (community_toolkit → is_community_toolkit) ### Benefits * Developer Freedom: Toolkit developers are no longer forced to use the arcade_ prefix. They are also no longer forced to use the package name as the toolkit name. * Cleaner Naming: External toolkits can use more natural names (e.g., my_company_toolkit instead of arcade_my_company_toolkit) * Better Discovery: Entry points provide a more standard Python mechanism for plugin discovery * Flexible Distribution: Toolkits can be distributed with any package name while still being discoverable ### Testing * Added comprehensive tests for the new entry point functionality * Tests cover edge cases like deduplication, error handling, and backward compatibility ### Version Bumps arcade-core: 2.0.0 → 2.1.0 arcade-ai: 2.0.5 → 2.1.0 This change makes the Arcade toolkit ecosystem more flexible and developer-friendly while maintaining full backward compatibility with existing toolkits. --------- Co-authored-by: Mateo Torres <mateo@arcade.dev>
69 lines
1.9 KiB
TOML
69 lines
1.9 KiB
TOML
[build-system]
|
|
requires = [ "hatchling",]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "{{ package_name }}"
|
|
version = "0.1.0"
|
|
{% if toolkit_description -%}
|
|
description = "{{ toolkit_description }}"
|
|
{% endif -%}
|
|
requires-python = ">=3.10"
|
|
dependencies = [
|
|
"arcade-tdk>={{ arcade_tdk_min_version }},<{{ arcade_tdk_max_version}}",
|
|
]
|
|
{% if toolkit_author_name or toolkit_author_email -%}
|
|
[[project.authors]]
|
|
{% if toolkit_author_name -%}
|
|
name = "{{ toolkit_author_name }}"
|
|
{% endif -%}
|
|
{% if toolkit_author_email -%}
|
|
email = "{{ toolkit_author_email }}"
|
|
{% endif -%}
|
|
{% endif %}
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"arcade-ai[evals]>={{ arcade_ai_min_version }},<{{ arcade_ai_max_version }}",
|
|
"arcade-serve>={{ arcade_serve_min_version }},<{{ arcade_serve_max_version }}",
|
|
"pytest>=8.3.0,<8.4.0",
|
|
"pytest-cov>=4.0.0,<4.1.0",
|
|
"pytest-mock>=3.11.1,<3.12.0",
|
|
"pytest-asyncio>=0.24.0,<0.25.0",
|
|
"mypy>=1.5.1,<1.6.0",
|
|
"pre-commit>=3.4.0,<3.5.0",
|
|
"tox>=4.11.1,<4.12.0",
|
|
"ruff>=0.7.4,<0.8.0",
|
|
]
|
|
|
|
# Tell Arcade.dev that this package is a toolkit
|
|
[project.entry-points.arcade_toolkits]
|
|
toolkit_name = "{{ package_name }}"
|
|
|
|
# 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 }
|
|
|
|
[tool.mypy]
|
|
files = [ "{{ package_name }}/**/*.py",]
|
|
python_version = "3.10"
|
|
disallow_untyped_defs = "True"
|
|
disallow_any_unimported = "True"
|
|
no_implicit_optional = "True"
|
|
check_untyped_defs = "True"
|
|
warn_return_any = "True"
|
|
warn_unused_ignores = "True"
|
|
show_error_codes = "True"
|
|
ignore_missing_imports = "True"
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = [ "tests",]
|
|
|
|
[tool.coverage.report]
|
|
skip_empty = true
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = [ "{{ package_name }}",]
|
|
|