Skip to content

Commit

Permalink
feat: Support Copier v6 (while keeping support for v5)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Dec 18, 2021
1 parent a5f95e2 commit 918bc1a
Show file tree
Hide file tree
Showing 22 changed files with 182 additions and 172 deletions.
24 changes: 17 additions & 7 deletions copier.yml
@@ -1,4 +1,14 @@
# CONFIGURATION -------------------------
_min_copier_version: "5.1.0"
_envops:
autoescape: false
block_end_string: "%}"
block_start_string: "{%"
comment_end_string: "#}"
comment_start_string: "{#"
keep_trailing_newline: true
variable_end_string: "}}"
variable_start_string: "{{"
_subdirectory: project
_templates_suffix: .jinja
_skip_if_exists:
Expand Down Expand Up @@ -52,22 +62,22 @@ repository_provider:
repository_namespace:
type: str
help: Your repository namespace
default: "[[ author_username ]]"
default: "{{ author_username }}"

repository_name:
type: str
help: Your repository name
default: "[[ project_name|lower|replace('_', '-')|replace(' ', '-') ]]"
default: "{{ project_name|lower|replace('_', '-')|replace(' ', '-') }}"

copyright_holder:
type: str
help: The name of the person/entity holding the copyright
default: "[[ author_fullname ]]"
default: "{{ author_fullname }}"

copyright_holder_email:
type: str
help: The email of the person/entity holding the copyright
default: "[[ author_email ]]"
default: "{{ author_email }}"

copyright_date:
type: str
Expand Down Expand Up @@ -116,17 +126,17 @@ copyright_license:
python_package_distribution_name:
type: str
help: Your Python package distribution name (for `pip install NAME`)
default: "[[ project_name|lower|replace('_', '-')|replace(' ', '-') ]]"
default: "{{ project_name|lower|replace('_', '-')|replace(' ', '-') }}"

python_package_import_name:
type: str
help: Your Python package import name (for `import NAME` in Python code)
default: "[[ project_name|lower|replace('-', '_')|replace(' ', '_') ]]"
default: "{{ project_name|lower|replace('-', '_')|replace(' ', '_') }}"

python_package_command_line_name:
type: str
help: Your CLI name if any (for use in the shell)
default: "[[ project_name|lower|replace('_', '-')|replace(' ', '-') ]]"
default: "{{ project_name|lower|replace('_', '-')|replace(' ', '-') }}"

use_precommit:
type: bool
Expand Down
10 changes: 5 additions & 5 deletions project/.github/FUNDING.yml.jinja
@@ -1,7 +1,7 @@
github:
- [[ author_username ]]
ko_fi: [[ author_username ]]
liberapay: [[ author_username ]]
patreon: [[ author_username ]]
- {{ author_username }}
ko_fi: {{ author_username }}
liberapay: {{ author_username }}
patreon: {{ author_username }}
custom:
- https://www.paypal.me/[[ author_username ]]
- https://www.paypal.me/{{ author_username }}
2 changes: 1 addition & 1 deletion project/.github/ISSUE_TEMPLATE/bug_report.md.jinja
Expand Up @@ -24,7 +24,7 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**System (please complete the following information):**
- `[[ project_name ]]` version: [e.g. 0.2.1]
- `{{ project_name }}` version: [e.g. 0.2.1]
- Python version: [e.g. 3.8]
- OS: [Windows/Linux]

Expand Down
2 changes: 1 addition & 1 deletion project/CODE_OF_CONDUCT.md.jinja
Expand Up @@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [[ author_email ]]. All
reported by contacting the project team at {{ author_email }}. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Expand Down
4 changes: 2 additions & 2 deletions project/CONTRIBUTING.md.jinja
Expand Up @@ -10,7 +10,7 @@ Nothing easier!
Fork and clone the repository, then:

```bash
cd [[ repository_name ]]
cd {{ repository_name }}
make setup
```

Expand All @@ -32,7 +32,7 @@ make setup

You now have the dependencies installed.

You can run the application with `pdm run [[ python_package_command_line_name ]] [ARGS...]`.
You can run the application with `pdm run {{ python_package_command_line_name }} [ARGS...]`.

Run `make help` to see all the available actions!

Expand Down

0 comments on commit 918bc1a

Please sign in to comment.