Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions devtools/setup-dev/ansible/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ sh_test(
"libvterm.yml",
"locate.yml",
"man.yml",
"mypy.yml",
"notmuch.yml",
"npm.yml",
"nvm.yml",
Expand Down Expand Up @@ -208,6 +209,7 @@ sh_test(
"setup-npm.yml",
"setup-nvm.yml",
"setup-perplexity-mcp.yml",
"setup-python-tools.yml",
"setup-rust.yml",
"setup-rust-tools.yml",
"setup-shell-profile.yml",
Expand Down Expand Up @@ -1385,6 +1387,20 @@ sh_test(
],
)

sh_test(
name = "mypy_syntax_test",
srcs = ["test_ansible_syntax.sh"],
args = ["mypy.yml"],
data = [
"mypy.yml",
"uv.yml",
],
tags = [
"ansible",
"local",
],
)

sh_test(
name = "notmuch_syntax_test",
srcs = ["test_ansible_syntax.sh"],
Expand Down Expand Up @@ -2266,6 +2282,23 @@ sh_test(
],
)

sh_test(
name = "setup-python-tools_syntax_test",
srcs = ["test_ansible_syntax.sh"],
args = ["setup-python-tools.yml"],
data = [
"mypy.yml",
"pylsp.yml",
"ruff.yml",
"setup-python-tools.yml",
"uv.yml",
],
tags = [
"ansible",
"local",
],
)

sh_test(
name = "setup-rust_syntax_test",
srcs = ["test_ansible_syntax.sh"],
Expand Down Expand Up @@ -2979,6 +3012,7 @@ test_suite(
":make_syntax_test",
":man_syntax_test",
":mono_syntax_test",
":mypy_syntax_test",
":notmuch_syntax_test",
":npm_syntax_test",
":nvm_syntax_test",
Expand Down Expand Up @@ -3033,6 +3067,7 @@ test_suite(
":setup-nvm_syntax_test",
":setup-pass_syntax_test",
":setup-perplexity-mcp_syntax_test",
":setup-python-tools_syntax_test",
":setup-rust-tools_syntax_test",
":setup-rust_syntax_test",
":setup-shell-profile_syntax_test",
Expand Down
1 change: 1 addition & 0 deletions devtools/setup-dev/ansible/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ These files are playbooks not generated from =generate_packages.go=:
- setup-nvm.yml
- setup-pass.yml
- setup-perplexity-mcp.yml
- setup-python-tools.yml
- setup-rust.yml
- setup-rust-tools.yml
- setup-shell-profile.yml
Expand Down
1 change: 1 addition & 0 deletions devtools/setup-dev/ansible/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
when: ansible_facts['os_family'] == "Darwin"
- import_playbook: setup-rust-tools.yml
- import_playbook: setup-sql-tools.yml
- import_playbook: setup-python-tools.yml
- import_playbook: setup-devtools.yml
44 changes: 44 additions & 0 deletions devtools/setup-dev/ansible/mypy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# THIS FILE IS AUTO-GENERATED by generate_packages.go - DO NOT EDIT MANUALLY
# To make changes, modify generate_packages.go, install_methods.go, packages_data.go, or templates.go
# and then run: make
- import_playbook: uv.yml

- name: Ensure mypy is present
hosts: all
tasks:
- name: Include guard for mypy playbook
block:
- name: Stop early if the mypy playbook is already included
meta: end_play
when: mypy_playbook_imported is defined
- name: Ensure the mypy playbook is not included
set_fact:
mypy_playbook_imported: true
when: mypy_playbook_imported is not defined

- name: Ensure mypy is present on MacOS
block:
- name: Check if mypy is installed
shell: command -v mypy
changed_when: False
rescue:
- name: Install mypy on MacOS
community.general.homebrew:
name: mypy
state: present
when: ansible_facts['os_family'] == "Darwin"

- name: Ensure mypy is present on Termux
block:
- name: Ensure mypy is installed with uv
shell: uv tool install mypy
args:
creates: ~/.local/bin/mypy
when: ansible_facts['env']['TERMUX_VERSION'] is defined

- name: Ensure mypy is installed with uv
shell: uv tool install mypy
args:
creates: ~/.local/bin/mypy
when: ansible_facts['env']['TERMUX_VERSION'] is not defined and ansible_facts['os_family'] != "Darwin"
9 changes: 9 additions & 0 deletions devtools/setup-dev/ansible/packages_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,15 @@ rm -rf $TMPDIR/codex
},
Imports: nil,
},
{
command: "mypy",
platforms: map[PlatformName]InstallMethod{
PlatformDarwin: BrewInstallMethod{Name: "mypy"},
PlatformDebianLike: UvInstallMethod{Name: "mypy"},
PlatformTermux: UvInstallMethod{Name: "mypy"},
},
Imports: nil,
},
{
command: "nvm",
platforms: map[PlatformName]InstallMethod{
Expand Down
5 changes: 5 additions & 0 deletions devtools/setup-dev/ansible/setup-python-tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
# setup-python-tools.yml - Python development tools
- import_playbook: ruff.yml # Formatter + Linter (already exists)
- import_playbook: pylsp.yml # Language server (already exists)
- import_playbook: mypy.yml # Type checker (to be added)
Loading