Commit 123bb3c
committed
♻️ Improve template structure
We had set up the template to have a `{{ plugin_name }}` directory at the root of the
`template` directory. The idea was that a user can just `copier copy` the template in
the current directory and it would automatically create a full directory structure for
the plugin package, where the root directory of the package would always match the
module directory in the `src`.
However, this creates issues when we want to start using `copier update`. Ideally, we'd
be able to use the previous answers stored in the `.copier-answers.yml` file. However,
this is created in the root directory of the template by `copier`. So it would be
created in the parent directory of our actual package with the current set up. This
means a user can not just go inside the `plugin_name` directory and run `copier update`.
We've looked for workarounds based on copying the `.copier-answers.yml` file inside the
`plugin_name` directory post `copier copy`, but they all were deemed messy, fragile and
perhaps even not fully functional. Instead, we restructured the template by:
1. Removing the `{{ plugin_name }}` subdirectory in the `template` directory, instead
moving its contents into the root `template` directory.
2. Using the `copier copy` `destination_path` (retrievable via `_copier_conf.dst_path`)
for the default of the `plugin_name` input.
This means the user can now run:
copier copy https://github.com/mbercx/aiida-plugin-copier <plugin_name>
and use the defaults to generate a new plugin package in the `<plugin_name>` directory.1 parent a73e054 commit 123bb3c
File tree
14 files changed
+7
-6
lines changed- docs
- template
- docs
- img
- src/{{ plugin_name.lower().replace('-', '_') }}
14 files changed
+7
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
0 commit comments