Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
dd79ccd
Rename template folder and files in preparation of migration to copier
lyashevska Jul 30, 2024
616ee56
Migrate from cookiecutter to copier
lyashevska Jul 30, 2024
d8ad6a8
Update template/README.md.jinja to copier
lyashevska Jul 30, 2024
39d374c
Update README.md to use copier
lyashevska Jul 30, 2024
7c89fe9
Handle directory_name
lyashevska Aug 1, 2024
ce6dd06
fix tests
egpbos Aug 1, 2024
e1163da
Escape quotes in name and description
lyashevska Aug 1, 2024
7d573c5
Merge pull request #414 from NLeSC/407-add-validators
lyashevska Aug 15, 2024
95c293d
Update readme dev
lyashevska Aug 15, 2024
755e961
Update README.dev.md
lyashevska Aug 15, 2024
d7d5dfb
Update README.dev.md
lyashevska Aug 15, 2024
3ae01a3
Merge pull request #418 from NLeSC/update-copier-readme.dev.md
lyashevska Aug 15, 2024
c7db00f
switch PR template instructions to copier
sjvrijn Aug 19, 2024
41177d8
restore mktemp instruction; add explanatory comments
sjvrijn Aug 19, 2024
98074b7
Update .github/PULL_REQUEST_TEMPLATE.md
sjvrijn Aug 19, 2024
b07cc6d
Merge pull request #437 from NLeSC/417-update-gh-pr-template
sjvrijn Aug 19, 2024
1401b8e
replace cookiecutter with copier in final files
sjvrijn Aug 19, 2024
6328722
Merge pull request #442 from NLeSC/remove-final-cookie-mentions
sjvrijn Aug 19, 2024
89168be
add messages when creating and copying files
Aug 19, 2024
a4218b5
add messages when creating and copying files
Aug 19, 2024
f31c6eb
remove double quotes
fdiblen Aug 19, 2024
03bb887
update the patch in before copy message
fdiblen Aug 19, 2024
d711d6a
update the patch in before copy message
fdiblen Aug 19, 2024
af6f53b
Merge pull request #443 from NLeSC/409_additional_messages
fdiblen Aug 19, 2024
344ca0f
fix typo
sjvrijn Aug 19, 2024
b805491
remove ADD_TO_EXISTING_PACKAGE file
sjvrijn Aug 19, 2024
79cea70
update usage instruction to explain 3 ways to use copier
sjvrijn Aug 19, 2024
6e09142
Update README.md
sjvrijn Aug 20, 2024
5f369e7
Update README.md
sjvrijn Aug 20, 2024
fc07bfe
Update README.md
sjvrijn Aug 20, 2024
5aa33de
Update README.md
sjvrijn Aug 20, 2024
227f82b
rename options/cases to scenarios
sjvrijn Aug 20, 2024
83c590d
Fix merge conflicts
lyashevska Aug 20, 2024
4debab7
Add pipx install instructions + explanation
sjvrijn Aug 20, 2024
399a7a1
scenarios as list
sjvrijn Aug 20, 2024
7548239
Merge pull request #444 from NLeSC/416-instructions-update-existing
sjvrijn Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add pipx install instructions + explanation
  • Loading branch information
sjvrijn committed Aug 20, 2024
commit 4debab7de1f2942f4b4dbb5bebbfa51ab1a1fba4
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,26 @@ There are multiple scenarios to use this template:
[Scenario 2](#scenario-2-apply-to-pre-existing-code): Applying the template to some pre-existing code
[Scenario 3](#scenario-3-updating-a-template-made-package): Updating a package made with the template

In all three scenarios, you will need to install copier first:
In all three scenarios, you will need to install Copier first, which we
recommend doing with [`pipx`](https://github.com/pypa/pipx):
```shell
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install copier
```

> [!NOTE]
> Note that it is also possible to install Copier with regular `pip`, but that
> Copier will then be installed in your common environment and may cause
> conflicts with its dependencies, while `pipx` will install Copier in a
> separate and dedicated environment.

### Scenario 1: Create a new package


#### Step 1/2: Create the files and directory structure

Run `copier` with the template:
Run `copier copy` with the template:

```shell
# Notes:
Expand Down Expand Up @@ -155,7 +164,7 @@ containing your existing code rather than a new one:
copier copy https://github.com/nlesc/python-template.git path/to/existing/code
```

This works because if `path/to/destination` already exists, `copier` will
This works because if `path/to/destination` already exists, Copier will
update what is already there by either adding new files or updating
existing files. Copier will ask to overwrite any files that resulted in
conflicts. Especially if your files are already under version control, it is
Expand All @@ -171,14 +180,18 @@ created project using the `copier update` command. This has two effects:
2. You can change any of your previous answers to apply these changes
throughout your entire project.

> [!CAUTION]
> Do not manually update answers in `.copier-answers.yml`,
> as it will result in unexpected behavior.

```shell
cd path/to/project
copier update
```

If you don't want to change any of your answers, but only want to update your
project according to the latest template updates, you can provide the
`--skip-answered` option. This tells copier to reuse all of your previous
`--skip-answered` option. This tells Copier to reuse all of your previous
answers, and simply bring in all updates from the template into
your current project, such as updating which Python versions are supported.
You will still be asked to answer any new questions that have been added to
Expand Down