-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcopier.yaml
More file actions
110 lines (90 loc) · 3.65 KB
/
copier.yaml
File metadata and controls
110 lines (90 loc) · 3.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# questions
repo_name:
type: str
help: What is the name of the repository?
repo_org_name:
type: str
help: What's the organization or username that owns this repository (look in the URL)?
repo_org_name_for_copyright:
type: str
help: What's the human-readable organization or username that should be set for the copyright?
default: "{{ repo_org_name }}"
description:
type: str
help: What is this copier template used for?
install_claude_cli:
type: bool
help: Should the Claude CLI be installed in the devcontainer?
default: no
python_version:
type: str
help: What version of Python?
default: "3.13.9"
python_ci_versions:
type: str
help: What versions should Python run CI on the instantiated template?
multiselect: true
choices:
- "3.12.7"
- "3.13.9"
- "3.14.0"
ssh_port_number:
type: int
help: What port should the devcontainer bind SSH to?
# Pick a random port, but ensure it's not in the excluded port range on Windows (powershell: `netsh int ipv4 show excludedportrange protocol=tcp`)
default: "{{ ( (range(49152, 49752) | list) + (range(49852, 50000) | list) + (range(50060, 50160) | list) + (range(50160, 50260) | list) + (range(50260, 50360) | list) + (range(50914, 51014) | list) + (range(51114, 51214) | list) + (range(51214, 51314) | list) + (range(51314, 51414) | list) + (range(51623, 51723) | list) + (range(51723, 51823) | list) + (range(65269, 65369) | list) + (range(65369, 65469) | list) ) | random }}"
template_uses_python:
type: bool
help: Is this a template that will use Python within it?
default: yes
template_uses_pulumi:
type: bool
help: Is this a template that will use Python Pulumi within it?
default: no
template_uses_javascript:
type: bool
help: Is this a template that will use Javascript within it?
default: no
template_uses_vuejs:
type: bool
help: Is this a template that will use VueJS within it?
default: no
when: "{{ template_uses_javascript }}"
template_might_want_to_install_aws_ssm_port_forwarding_plugin:
type: bool
help: Is this template for something that might want the AWS SSM Port Forwarding plugin be installed?
default: no
template_might_want_to_use_vcrpy:
type: bool
help: Is this template for something that might want to use VCRpy during unit testing?
default: no
when: "{{ template_uses_python }}"
template_might_want_to_use_python_asyncio:
type: bool
help: Is this template for something that might want to use Python asyncio?
default: no
when: "{{ template_uses_python }}"
_tasks:
- command: |
python3 '{{ _copier_conf.src_path }}/src/copier_tasks/remove_precommit_hooks.py' \
--hook-id-regex '^\s*-\s+id:\s+merge-claude-settings\s*$' \
--target-file .pre-commit-config.yaml
when: "{{ not install_claude_cli }}"
- command: |
if [ -f ruff.toml ]; then
echo "Updating ruff target-version from python_version..."
py_major_minor="$(printf '%s' '{{ python_version }}' | cut -d. -f1,2)"
py_tag="py$(printf '%s' "$py_major_minor" | tr -d '.')"
sed -i -E 's/^target-version = "py[0-9]+"/target-version = "'"$py_tag"'"/' ruff.toml
else
echo "ruff.toml not found; skipping Ruff target-version update."
fi
_min_copier_version: "9.7"
_subdirectory: template
_templates_suffix: .jinja-base
_exclude:
- "copier.yaml"
# adapted from https://github.com/copier-org/copier-template-extensions#context-hook-extension
_jinja_extensions:
- copier_template_extensions.TemplateExtensionLoader
- extensions/context.py:ContextUpdater