Skip to content

Commit 2379cbf

Browse files
author
Ware, Joseph (DLSLtd,RAL,LSCI)
committed
fix: Remove need for --trust
1 parent dfe17b1 commit 2379cbf

7 files changed

Lines changed: 12 additions & 15 deletions

File tree

.github/workflows/_example.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
- name: Regenerate example
1818
run: |
19-
pipx run copier copy --data-file example-answers.yml --trust --vcs-ref=HEAD . example
19+
pipx run copier copy --data-file example-answers.yml --vcs-ref=HEAD . example
2020
2121
- name: Rewrite copier answers
2222
run: |

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ Visit <https://dev-portal.diamond.ac.uk/create> and you will see a list of templ
4646
You will need to `pip install copier` inside an activated `venv` from python3.11 or later, then you can create a new module via:
4747

4848
```
49-
mkdir /path/to/my-project
50-
# The --trust argument is required to run setup tasks such as initializing a git repository
51-
copier copy --trust https://github.com/DiamondLightSource/python-copier-template.git /path/to/my-project
49+
git init --initial-branch=main /path/to/my-project
50+
# $_ resolves to /path/to/my-project
51+
copier copy https://github.com/DiamondLightSource/python-copier-template.git $_
5252
```
5353

5454
You can also use it via `pipx run copier` if you have that installed.

copier.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ sphinx:
156156

157157
_subdirectory: "template"
158158

159-
_tasks:
160-
- "git init --initial-branch=main"
161-
162159
_migrations:
163160
- version: 2.0.0
164161
before:

docs/how-to/update-template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
To track changes to the upstream template, run
66

77
```
8-
copier update --trust
8+
copier update
99
```
1010

1111
This will fetch the latest tagged release of the template, and apply any changes to your working copy. It will prompt for answers again, giving your previous answers as the defaults.
@@ -32,7 +32,7 @@ The following steps are recommended to update your project, especially for infre
3232
- fix issues found by the above
3333
- commit the changes
3434
- update the template
35-
- `copier update --trust`
35+
- `copier update`
3636
- fix any merge conflicts
3737
- validate that the project still works
3838
- `tox -p`

docs/tutorials/adopt-existing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Copier will *overwrite* files with the template files. Please check the changes
1818
If you have a [python3-pip-skeleton](https://github.com/DiamondLightSource/python3-pip-skeleton) based project then it is best to adopt the `1.0.0` release of this template, then `copier update` to get to the latest. This is because `copier update` will try and merge file changes across renames done between releases, while `copier copy` cannot. This looks like:
1919

2020
```shell
21-
copier copy https://github.com/DiamondLightSource/python-copier-template.git --trust --vcs-ref=1.0.0 /path/to/existing-project
21+
copier copy https://github.com/DiamondLightSource/python-copier-template.git --vcs-ref=1.0.0 /path/to/existing-project
2222
git diff
2323
# Examine the changes, put back anything you want to keep
2424
git commit -m "Adopt python-copier-template 1.0.0"
25-
copier update --trust /path/to/existing-project
25+
copier update /path/to/existing-project
2626
git diff
2727
# Examine the changes, resolve any merge conflicts
2828
git commit -m "Update to python-copier-template x.x.x"
@@ -33,7 +33,7 @@ git commit -m "Update to python-copier-template x.x.x"
3333
If you have a project with a different structure then it is best to go straight to the latest release:
3434

3535
```shell
36-
copier copy --trust https://github.com/DiamondLightSource/python-copier-template.git /path/to/existing-project
36+
copier copy https://github.com/DiamondLightSource/python-copier-template.git /path/to/existing-project
3737
git diff
3838
# Examine the changes, put back anything you want to keep
3939
git commit -m "Adopt python-copier-template x.x.x"

docs/tutorials/create-new.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Once you have followed the [](./installation) tutorial, you can use `copier` to make a new project from the template:
44

55
```
6-
$ mkdir /path/to/my-project
7-
$ copier copy --trust https://github.com/DiamondLightSource/python-copier-template.git /path/to/my-project
6+
$ git init --initial-branch=main /path/to/my-project
7+
$ copier copy https://github.com/DiamondLightSource/python-copier-template.git $_
88
```
99

1010
This will:

tests/test_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_example_repo_updates(tmp_path: Path):
170170
run("git config user.email 'you@example.com'")
171171
run("git config user.name 'Your Name'")
172172
run("git commit -am 'Update src'")
173-
run(f"copier update --trust --vcs-ref=HEAD --data-file {TOP}/example-answers.yml")
173+
run(f"copier update --vcs-ref=HEAD --data-file {TOP}/example-answers.yml")
174174
output = run(
175175
# Git directory expected to be different
176176
"diff -ur --exclude=.git "

0 commit comments

Comments
 (0)