Skip to content

Commit

Permalink
Start template
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopalmeiro committed Aug 7, 2022
1 parent 126822d commit 8a220bf
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Pipfile.lock
.venv/

demo/
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["samuelcolvin.jinjahtml"]
}
13 changes: 13 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
copier = "==6.1.0"
djlint = "==1.9.4"

[dev-packages]

[requires]
python_version = "3.7"
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# copier-cli
Copier template for Python CLIs with Click and Poetry.

[Copier](https://github.com/copier-org/copier) template for Python CLIs with Click and Poetry.

## Development

- `export PIPENV_VENV_IN_PROJECT=1 && pipenv install --python 3.7`
- `pipenv run copier --version`
- `pipenv run djlint project/* --lint --profile=jinja`
- `pipenv run djlint project/\{\{_copier_conf.answers_file\}\}.jinja --reformat --profile=jinja`
- `rm -rf demo && pipenv run copier . demo`

## Notes

- [Copier](https://github.com/copier-org/copier):
- [Documentation](https://copier.readthedocs.io/en/latest/)
- [pdm-project/copier-pdm](https://github.com/pdm-project/copier-pdm) template
- [pawamoy/copier-pdm](https://github.com/pawamoy/copier-pdm) template
- [pawamoy/copier-poetry](https://github.com/pawamoy/copier-poetry) template
- Install: `pipx install copier`
- ['save-exact' option for saving exact version in Pipfile](https://github.com/pypa/pipenv/issues/3441) (open) issue
- [djLint](https://djlint.com/):
- [Linter](https://djlint.com/docs/linter/)
- [VS Code extension](https://marketplace.visualstudio.com/items?itemName=monosans.djlint)
- `pipenv run djlint project/* --check --profile=jinja`
- `pipenv run djlint project/* --reformat --profile=jinja`
10 changes: 10 additions & 0 deletions copier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://copier.readthedocs.io/en/latest/configuring/#jinja_extensions
# https://github.com/hackebrot/jinja2-time
# https://cookiecutter.readthedocs.io/en/latest/advanced/template_extensions.html

_subdirectory: project

author_name:
type: str
help: Your name
default: "João Palmeiro"
21 changes: 21 additions & 0 deletions project/LICENSE.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 {{ author_name }}

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 4 additions & 0 deletions project/{{_copier_conf.answers_file}}.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changes here will be overwritten by Copier
# https://copier.readthedocs.io/en/latest/configuring/#the-copier-answersyml-file
# https://copier.readthedocs.io/en/latest/creating/#minimal-example
{{ _copier_answers|to_nice_yaml }}

0 comments on commit 8a220bf

Please sign in to comment.