-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to create cookiecutter project and to run pre-commit on th…
…e generated project
- Loading branch information
1 parent
3d9aa92
commit 09b0bb4
Showing
3 changed files
with
56 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
__pycache__ | ||
dist | ||
.idea | ||
venv* | ||
.venv* | ||
.env | ||
.env* | ||
*.lock | ||
.vscode | ||
.pypirc | ||
.pytest_cache | ||
.ruff_cache | ||
.mypy_cache | ||
.coverage* | ||
.cache | ||
htmlcov | ||
token | ||
.DS_Store | ||
|
||
generated/ |
This file contains 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# This script is used to test the cookiecutter template | ||
# It will create a new project using the cookiecutter template under the generated/ directory | ||
# The script accepts two positional arguments: app-type and python-version | ||
# The cookiecutter replay file is used to provide the default values for the cookiecutter template | ||
|
||
# Accept two arguments: app-type and python-version | ||
echo "Generating project using cookiecutter template with app-type: $1 and python-version: $2" | ||
cookiecutter -f --replay-file ./cookiecutter_replay/$1_$2.json --output-dir generated/ ./ | ||
|
||
# Install generated project's dependencies | ||
echo "Installing dependencies for the generated project" | ||
cd generated/my_fastagency_app && pip install -e .[dev] && cd ../../ | ||
|
||
# Initialize git in the generated project(needed for pre-commit) | ||
echo "Initializing git in the generated project" | ||
cd generated/my_fastagency_app && git init && git add . && cd ../../ | ||
|
||
# Run pre-commit | ||
echo "Running pre-commit" | ||
cd generated/my_fastagency_app && pre-commit run --show-diff-on-failure --color=always --all-files && cd ../../ |