forked from browniebroke/pypackage-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
copier.yml
123 lines (104 loc) · 3.46 KB
/
copier.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
# questions
full_name:
type: str
help: "What's your name?"
email:
type: str
help: "Email address"
placeholder: "[email protected]"
github_username:
type: str
help: "GitHub Username"
is_django_package:
type: bool
help: "Is the project a Django package?"
default: no
project_name:
type: str
help: "Project Name (human readable version){% if is_django_package %}, should start by 'Django'{% endif %}."
placeholder: "Python Package"
project_slug:
type: str
help: "Project slug (used for GitHub, PyPI, etc.){% if is_django_package %}, should start by 'django-'{% endif %}."
default: "{{ project_name.lower().replace(' ', '-') }}"
package_name:
type: str
help: "The name of the main Python package (should be a valid Python identifier{% if is_django_package %} and start by 'django_'{% endif %})"
default: "{{ project_slug.replace('-', '_') }}"
django_app_shorthand:
type: str
help: "The Django app shorthand, typically the package name without the 'django_' prefix."
default: "{{ package_name.removeprefix('django_') }}"
when: "{{ is_django_package }}"
project_short_description:
type: str
help: "A short description of the project"
placeholder: "A super helpful small Python package."
open_source_license:
type: str
help: "The open source license to use"
choices:
- "MIT"
- "Apache Software License 2.0"
- "GNU General Public License v3"
- "Not open source"
copyright_year:
type: str
help: "Copyright year(s)"
default: "2022"
documentation:
type: bool
help: "Generate documentation?"
default: yes
has_cli:
type: bool
help: "Does the project have a CLI?"
default: no
cli_name:
type: str
help: "The name of the CLI"
default: "{{ project_slug }}"
when: "{{ has_cli }}"
run_poetry_install:
type: bool
help: "Run poetry install after {{ package_name }} generation?"
default: no
initial_commit:
type: bool
help: "Create an initial commit with the generated {{ package_name }}?"
default: no
setup_github:
type: bool
help: "Setup GitHub repository (requires gh CLI)?"
default: no
setup_pre_commit:
type: bool
help: "Setup pre-commit hooks (requires pre-commit)?"
default: no
add_me_as_contributor:
type: bool
help: "Add me as a contributor?"
default: no
# Copier metadata
_min_copier_version: "9.0.0"
_subdirectory: "project"
_tasks:
# Remove license file if no license
- "{% if open_source_license == 'Not open source' %}rm LICENSE{% endif %}"
# Cleanup docs
- "{% if not documentation %}rm -rf docs .readthedocs.yml{% endif %}"
# Run poetry install
- "{% if run_poetry_install %}poetry install{% endif %}"
# Initial commit
- "{% if initial_commit %}git init{% endif %}"
- "{% if initial_commit %}git add .{% endif %}"
- "{% if initial_commit %}git commit -m 'chore: initial commit'{% endif %}"
# Setup GitHub
- "{% if setup_github %}gh repo create {{ github_username }}/{{ project_slug }} -d '{{ project_short_description }}' --public --remote=origin --source=. --push{% endif %}"
- "{% if setup_github %}gh repo edit --delete-branch-on-merge --enable-projects=false --enable-wiki=false{% endif %}"
- "{% if setup_github %}gh secret set GH_PAT -b 'changeme'{% endif %}"
- "{% if setup_github %}gh secret set CODECOV_TOKEN -b 'changeme'{% endif %}"
# Setup pre-commit
- "{% if setup_pre_commit %}pre-commit install{% endif %}"
# Add me as a contributor
- "{% if add_me_as_contributor %}npx all-contributors-cli add {{ github_username }} code,ideas,doc{% endif %}"