Skip to content

Commit 74932e3

Browse files
committed
Initial commit
0 parents  commit 74932e3

File tree

13 files changed

+703
-0
lines changed

13 files changed

+703
-0
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use nix

.generator.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changes here will be overwritten by Copier
2+
_commit: 0.1.0
3+
_src_path: https://github.com/fastapi-mvc/copier-generator.git
4+
copyright_date: 2022
5+
generator: script
6+
generator_name: script
7+
license: MIT
8+
nix: true
9+
repo_url: https://your.repo.url.here

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
*.egg-info/
7+
.installed.cfg
8+
*.egg
9+
10+
# Unit test / coverage reports
11+
htmlcov/
12+
.tox/
13+
.coverage
14+
.coverage.*
15+
.cache
16+
nosetests.xml
17+
coverage.xml
18+
*,cover
19+
.hypothesis/
20+
flake8_code_errors.txt
21+
pep257_violations.txt
22+
pep8_violations.txt
23+
code_complexity.txt
24+
xunit-*.xml
25+
26+
# PyCharm
27+
.idea
28+
29+
# virtual
30+
venv
31+
.venv
32+
33+
# direnv
34+
.direnv
35+
36+
# Nix build result
37+
result

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Changelog
2+
3+
This file documents changes to [copier-script](https://your.repo.url.here). The release numbering uses [semantic versioning](http://semver.org).
4+
5+
## 0.1.0
6+
7+
* Initial release

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022-present
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
## Copier Script
2+
3+
Copier template for scaffolding new script upon [fastapi-mvc](https://github.com/fastapi-mvc/fastapi-mvc) project.
4+
5+
## Quickstart
6+
7+
To use this template outside `fastapi-mvc`:
8+
9+
Prerequisites:
10+
11+
* Python 3.8 or later [How to install python](https://docs.python-guide.org/starting/installation)
12+
* Git 2.27 or newer
13+
* copier 6.2.0 or later
14+
15+
```shell
16+
copier copy "https://your.repo.url.here.git" /path/to/your/new/project
17+
```
18+
19+
## Using Nix
20+
21+
```shell
22+
nix-shell shell.nix
23+
copier copy "https://your.repo.url.here.git" /path/to/your/new/project
24+
```
25+
26+
## Updating
27+
28+
To update your generator with the changes from the [upstream](https://github.com/fastapi-mvc/copier-generator) run:
29+
30+
```shell
31+
./update.sh
32+
```
33+
34+
This action will not update/override your template and its configuration, but rather generators common files:
35+
36+
* Environment (`pyproject.toml` and `poetry.lock`)
37+
* `README.md`
38+
* Nix expression files
39+
* dotfiles
40+
* `LICENSE`
41+
42+
List of excluded files/paths:
43+
44+
* `template/**`
45+
* `copier.yml`
46+
* `*.py`
47+
* `CHANGELOG.md`
48+
49+
Lastly, you can pass extra copier CLI options should you choose:
50+
51+
```shell
52+
./update.sh -x README.md
53+
```

copier.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# TEMPLATE SETTINGS
2+
_subdirectory: template
3+
_templates_suffix: .jinja
4+
_min_copier_version: "6.2.0"
5+
_envops:
6+
block_end_string: "%}"
7+
block_start_string: "{%"
8+
comment_end_string: "#}"
9+
comment_start_string: "{#"
10+
keep_trailing_newline: true
11+
variable_end_string: "}}"
12+
variable_start_string: "{{"
13+
14+
# TEMPLATE QUESTIONS
15+
project_name:
16+
type: str
17+
help: >-
18+
What's your project name?
19+
20+
Do not use dots or spaces in the name; just "A-Za-z0-9-_" please.
21+
22+
name:
23+
type: str
24+
help: What is the name to greet for the generator hello world example?
25+
26+
# TEMPLATE NONE-CONFIGURABLE DEFAULTS
27+
package_name:
28+
type: str
29+
default: "{{ project_name|lower|replace(' ','_')|replace('-','_') }}"
30+
when: false

default.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{ python
2+
, poetry2nix
3+
}:
4+
5+
poetry2nix.mkPoetryEnv {
6+
inherit python;
7+
pyproject = ./pyproject.toml;
8+
poetrylock = ./poetry.lock;
9+
}

0 commit comments

Comments
 (0)