-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopier.yml
More file actions
191 lines (153 loc) · 6.81 KB
/
copier.yml
File metadata and controls
191 lines (153 loc) · 6.81 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
_subdirectory: template_sources
_templates_suffix: .j2
_exclude:
- copier.yml
- "*.py[co]"
- __pycache__
- .git
- name-slug
application_type:
type: str
help: What kind of application are you creating?
choices:
- Nova Application
- NDIP Tool
- Command-line tool
- Library
- Tutorial
- Minimal
project_name:
type: str
help: What is your project name?
python_package:
type: str
help: What is your Python package name (use Python naming conventions, use dots to create submodules)?
default: "{% include 'name_slug.j2' %}"
when: "{{ application_type != 'Minimal' }}"
tool_category:
type: str
help: Which category will your tool belong to?
choices:
Chemical Spectroscopy: chemical-spectroscopy
Direct-Geometry Spectroscopy: direct-geometry-spectroscopy
Engineering Diffraction: engineering-diffraction
Fusion: fusion
Generic: generic
Imaging: imaging
Powder Diffraction: powder-diffraction
Reflectometry: reflectometry
Single Crystal Diffraction: single-crystal-diffraction
Small Angle Neutron Scattering: small-angle-neutron-scattering
Triple-Axis Spectroscopy: spectroscopy
# --- Nova Application Specific ---
# Implicitly GUI if Nova Application is chosen.
framework:
type: str
help: Which GUI library will you use?
choices:
- Trame
- PyQt5
- PyQt6
default: Trame
when: "{{ application_type in ['Nova Application', 'Tutorial'] }}"
multitabs:
type: bool
help: Do you want a template with multiple tabs?
default: no
when: "{{ application_type in ['Nova Application', 'Tutorial'] and framework=='Trame' }}"
# --- Library Specific ---
publish_to_pypi:
type: bool
help: Publish to PyPI?
default: no
when: "{{ application_type == 'Library' }}"
publish_docs:
type: bool
help: Publish API documentation to readthedocs.io?
default: no
when: "{{ application_type == 'Library' }}"
# --- Minimal Specific ---
# We'll add questions for the minimal version later if needed,
# potentially reading from a separate config file.
# --- Tutorial Specific ---
# Tutorial might inherit settings or have its own specific ones.
# We'll handle this when incorporating the tutorial template changes.
_message_after_copy: |
Your "{{ application_type }}" project "{{ project_name }}" has been created successfully!
Next steps:
1. Change directory to the project root:
$ cd {{ _copier_conf.dst_path }}
{% if application_type != 'Minimal' %}
2. Read "DEVELOPMENT.md" for development guidelines!
3. Install project dependencies and setup pre-commit:
$ pixi install
$ pixi run pre-commit install
{% else %}
2. Review the generated files, including `minimal_config.yaml`.
You may need to install dependencies like 'git', 'docker', 'bash', 'sed', 'grep', 'mktemp' manually if not already present.
{% endif %}
{% if application_type in ['Nova Application', 'NDIP Tool'] %}
4. Initialize the Git repository:
$ pixi run init-repo
This script will show you the planned actions and ask for confirmation.
It will NOT push automatically. After running, review the changes and push manually:
$ git status
$ git diff --staged
$ git push --set-upstream origin main
5. Test if the application runs:
$ pixi run app
{% if application_type == 'Nova Application' %}
If there are any problems with GUI dependencies (like PyQt/Trame) you might need to install/update system libraries.
{% endif %}
6. Deploy the tool XML to the Galaxy tools repository on the prototype branch:
$ pixi run deploy-prototype
This script will also ask for confirmation before committing and pushing to the Galaxy tools repo.
Ensure your Docker image is built and pushed first (see DEVELOPMENT.md or Dockerfile).
7. Start coding! Remember to document your work (see DEVELOPMENT.md). Continue to update the version in pyproject.toml and run deploy-prototype as needed.
8. When you're ready to make your tool available to users, deloy the tool XML to the Galaxy tools repository on the dev branch:
$ pixi run deploy-production
This script will first create a new branch with your XML, then create a merge request from that branch to the dev branch.
This will start the process of making your tool available to users on calvera. You should also review the MR and assign a reviewer.
{% elif application_type == 'Command-line tool' %}
4. Initialize Git repository manually (if desired):
$ git init -b main
$ git add .
$ git commit -m "Initial commit"
# Add remote and push if needed
5. Test if the application runs:
$ pixi run app
6. Start coding! Remember to document your work (see DEVELOPMENT.md).
{% elif application_type == 'Library' %}
4. Initialize Git repository manually (if desired):
$ git init -b main
$ git add .
$ git commit -m "Initial commit"
# Add remote and push if needed
{% if publish_to_pypi %}
5. Configure PyPI publishing details in `pyproject.toml` and follow [Hatch's](https://hatch.pypa.io/latest/) publishing guide.
{% endif %}
{% if publish_docs %}
6. Configure Readthedocs integration (see `.readthedocs.yml` and `docs/conf.py`). Build docs locally with `pixi run sphinx-build docs docs/_build/html`.
{% endif %}
7. Start developing your library! Remember to write tests and documentation (see DEVELOPMENT.md).
{% elif application_type == 'Tutorial' %}
4. Follow the specific instructions provided in the generated tutorial documentation (e.g., TUTORIAL.md or README.md) for next steps.
This likely involves installing dependencies, running setup scripts, and testing the application.
$ pixi install
$ pixi run pre-commit install
# (Check tutorial docs for specific init-repo/deploy-tool usage if applicable)
{% elif application_type == 'Minimal' %}
3. Initialize the Git repository:
$ ./scripts/init-repo.sh
This script will show you the planned actions and ask for confirmation.
It will NOT push automatically. After running, review the changes and push manually:
$ git status
$ git diff --staged
$ git push --set-upstream origin main
4. Deploy the tool XML to the Galaxy tools repository:
$ ./scripts/deploy-tool.sh
This script will also ask for confirmation before committing and pushing to the Galaxy tools repo.
Ensure your Docker image (see `dockerfiles/Dockerfile`) is built and pushed first.
Update `minimal_config.yaml` if the version changes.
5. Start developing your application! Remember to update `minimal_config.yaml` as needed.
{% endif %}