From ab34d3ad8ee76cb6c59399bdd261a54b2a818e39 Mon Sep 17 00:00:00 2001 From: Mateo Torres Date: Mon, 30 Jun 2025 19:19:15 -0300 Subject: [PATCH] patching toolkit template generator for outside the main repo (#460) The current `arcade new` command fails to `make install` and `make check` if it's not manually patched with pre-commit files. It also fails due to local dependencies if it's not run inside `arcade-ai/toolkits` This PR patches the toolkit template to only include the local dependencies if it detects is `arcade new` being run inside `arcade-ai/toolkits`, it also makes pre-commit commands optional. --- .../arcade_cli/templates/{{ toolkit_name }}/Makefile | 10 ++++++---- .../templates/{{ toolkit_name }}/pyproject.toml | 1 - toolkits/asana/Makefile | 10 ++++++---- toolkits/code_sandbox/Makefile | 10 ++++++---- toolkits/confluence/Makefile | 10 ++++++---- toolkits/dropbox/Makefile | 10 ++++++---- toolkits/github/Makefile | 10 ++++++---- toolkits/google/Makefile | 10 ++++++---- toolkits/hubspot/Makefile | 10 ++++++---- toolkits/jira/Makefile | 10 ++++++---- toolkits/linkedin/Makefile | 10 ++++++---- toolkits/math/Makefile | 10 ++++++---- toolkits/microsoft/Makefile | 10 ++++++---- toolkits/notion/Makefile | 10 ++++++---- toolkits/reddit/Makefile | 10 ++++++---- toolkits/salesforce/Makefile | 10 ++++++---- toolkits/search/Makefile | 10 ++++++---- toolkits/slack/Makefile | 10 ++++++---- toolkits/spotify/Makefile | 10 ++++++---- toolkits/stripe/Makefile | 10 ++++++---- toolkits/web/Makefile | 10 ++++++---- toolkits/x/Makefile | 10 ++++++---- toolkits/zoom/Makefile | 10 ++++++---- 23 files changed, 132 insertions(+), 89 deletions(-) diff --git a/libs/arcade-cli/arcade_cli/templates/{{ toolkit_name }}/Makefile b/libs/arcade-cli/arcade_cli/templates/{{ toolkit_name }}/Makefile index 7e2c686e..701ce7a8 100644 --- a/libs/arcade-cli/arcade_cli/templates/{{ toolkit_name }}/Makefile +++ b/libs/arcade-cli/arcade_cli/templates/{{ toolkit_name }}/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/libs/arcade-cli/arcade_cli/templates/{{ toolkit_name }}/pyproject.toml b/libs/arcade-cli/arcade_cli/templates/{{ toolkit_name }}/pyproject.toml index 2afbb64a..a1379510 100644 --- a/libs/arcade-cli/arcade_cli/templates/{{ toolkit_name }}/pyproject.toml +++ b/libs/arcade-cli/arcade_cli/templates/{{ toolkit_name }}/pyproject.toml @@ -42,7 +42,6 @@ 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" diff --git a/toolkits/asana/Makefile b/toolkits/asana/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/asana/Makefile +++ b/toolkits/asana/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/code_sandbox/Makefile b/toolkits/code_sandbox/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/code_sandbox/Makefile +++ b/toolkits/code_sandbox/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/confluence/Makefile b/toolkits/confluence/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/confluence/Makefile +++ b/toolkits/confluence/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/dropbox/Makefile b/toolkits/dropbox/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/dropbox/Makefile +++ b/toolkits/dropbox/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/github/Makefile b/toolkits/github/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/github/Makefile +++ b/toolkits/github/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/google/Makefile b/toolkits/google/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/google/Makefile +++ b/toolkits/google/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/hubspot/Makefile b/toolkits/hubspot/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/hubspot/Makefile +++ b/toolkits/hubspot/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/jira/Makefile b/toolkits/jira/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/jira/Makefile +++ b/toolkits/jira/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/linkedin/Makefile b/toolkits/linkedin/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/linkedin/Makefile +++ b/toolkits/linkedin/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/math/Makefile b/toolkits/math/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/math/Makefile +++ b/toolkits/math/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/microsoft/Makefile b/toolkits/microsoft/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/microsoft/Makefile +++ b/toolkits/microsoft/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/notion/Makefile b/toolkits/notion/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/notion/Makefile +++ b/toolkits/notion/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/reddit/Makefile b/toolkits/reddit/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/reddit/Makefile +++ b/toolkits/reddit/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/salesforce/Makefile b/toolkits/salesforce/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/salesforce/Makefile +++ b/toolkits/salesforce/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/search/Makefile b/toolkits/search/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/search/Makefile +++ b/toolkits/search/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/slack/Makefile b/toolkits/slack/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/slack/Makefile +++ b/toolkits/slack/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/spotify/Makefile b/toolkits/spotify/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/spotify/Makefile +++ b/toolkits/spotify/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/stripe/Makefile b/toolkits/stripe/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/stripe/Makefile +++ b/toolkits/stripe/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/web/Makefile b/toolkits/web/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/web/Makefile +++ b/toolkits/web/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/x/Makefile b/toolkits/x/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/x/Makefile +++ b/toolkits/x/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml diff --git a/toolkits/zoom/Makefile b/toolkits/zoom/Makefile index 7e2c686e..701ce7a8 100644 --- a/toolkits/zoom/Makefile +++ b/toolkits/zoom/Makefile @@ -8,14 +8,14 @@ help: install: ## Install the uv environment and install all packages with dependencies @echo "🚀 Creating virtual environment and installing all packages using uv" @uv sync --active --all-extras --no-sources - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run --no-sources pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .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 - @uv run pre-commit install + @if [ -f .pre-commit-config.yaml ]; then uv run pre-commit install; fi @echo "✅ All packages and dependencies installed via uv" .PHONY: build @@ -47,7 +47,9 @@ bump-version: ## Bump the version in the pyproject.toml file by a patch version .PHONY: check check: ## Run code quality tools. - @echo "🚀 Linting code: Running pre-commit" - @uv run pre-commit run -a + @if [ -f .pre-commit-config.yaml ]; then\ + echo "🚀 Linting code: Running pre-commit";\ + uv run --no-sources pre-commit run -a;\ + fi @echo "🚀 Static type checking: Running mypy" @uv run mypy --config-file=pyproject.toml