-
Notifications
You must be signed in to change notification settings - Fork 84
Update to copier in ./README.dev.md #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Update readme dev
- Loading branch information
commit 95c293db07b2b86383e2ebce206c0cb1f13dc399
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,15 +4,17 @@ If you're looking for user documentation, go [here](README.md). | |
|
|
||
| ## Development install | ||
|
|
||
| ### Install `cookiecutter` in user space | ||
| ### Install `copier` in user space | ||
|
|
||
| We recommend installing `cookiecutter` in user space as per `cookiecutter`'s instructions. This way, you don't have to | ||
| install `cookiecutter` for every new project. | ||
| We recommend installing `copier` in user space. This way, you don't have to | ||
| install `copier` for every new project. | ||
|
|
||
| ```shell | ||
| python -m pip install --user --upgrade cookiecutter | ||
| python -m pip install --user --upgrade copier | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| ### Get your own copy of the repository | ||
|
|
||
| Before you can do development work on the template, you'll need to check out a local copy of the repository: | ||
|
|
@@ -23,6 +25,13 @@ git clone https://github.com/NLeSC/python-template.git | |
| cd python-template | ||
| ``` | ||
|
|
||
| Please note that if you are working from some other branch than `main`, you should switch to that branch. For example, if you are working from the `dev` branch, you should do: | ||
|
|
||
| ```shell | ||
| git fetch origin | ||
| git switch -c dev origin/dev | ||
| ``` | ||
|
|
||
| ### Create a virtual environment | ||
|
|
||
| Next, make a virtual environment, activate it, and install the development dependencies in it. This will enable you to | ||
|
|
@@ -53,27 +62,28 @@ pytest | |
| pytest tests/ | ||
| ``` | ||
|
|
||
| ## Using `cookiecutter` to generate a new package from the command line | ||
| ## Using `copier` to generate a new package from the command line | ||
|
|
||
| While making changes to the template, you'll regularly want to verify that the packages generated with the template | ||
| still work. Any easy way to do this is to generate new packages in a temporary directory (which will get removed | ||
| everytime you reboot), for example like so: | ||
|
|
||
| ```shell | ||
| # change directory to a new temporary directory | ||
| cd $(mktemp -d --tmpdir cookiecutter-generated.XXXXXX) | ||
| cd $(mktemp -d --tmpdir copier-generated.XXXXXX) | ||
|
|
||
| # run cookiecutter with the template to generate a new package | ||
| cookiecutter <path to where your template is> | ||
| # run copier with the template to generate a new package | ||
| copier copy --vcs-ref HEAD <path/to/project/template> <path/to/destination> | ||
|
|
||
| # when it asks you for the GitHub organization, put in your own name; | ||
| # for the other questions, just accept the default | ||
|
|
||
| # 'ls' should return just the one directory called 'my-python-project' | ||
| ls | ||
| ``` | ||
| Notice, that the `--vcs-ref HEAD` flag is used to make sure that the current checked out version of a local template are used. | ||
lyashevska marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| If your Python package was created successfully, `cookiecutter` will point you to a file | ||
| If your Python package was created successfully, `copier` will point you to a file | ||
| (`my-python-project/next_steps.md`) that contains information on next steps. | ||
|
Comment on lines
+86
to
87
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still true?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, we leave it for now, this will be addressed in #409 |
||
|
|
||
| In addition to the information in `my-python-project/project_setup.md`, the developer documentation | ||
|
|
@@ -95,7 +105,7 @@ Follow the instructions from `my-python-project/README.dev.md` and make sure tha | |
| 2. Verify that the information in `CITATION.cff` is correct. | ||
| 3. Make sure that `version` in [setup.cfg](setup.cfg) and `version` in [CITATION.cff](CITATION.cff) have been bumped to the to-be-released version of the template | ||
| 4. Run the unit tests with `pytest tests/` | ||
| 5. Go through the steps outlined above for [generating a new package from the command line](#using-cookiecutter-to-generate-a-new-package-from-the-command-line), and verify that the generated package works as it should. | ||
| 5. Go through the steps outlined above for [generating a new package from the command line](#using-copier-to-generate-a-new-package-from-the-command-line), and verify that the generated package works as it should. | ||
|
|
||
| ### GitHub | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.