Skip to content

Instantly share code, notes, and snippets.

@emersonmx
Last active June 6, 2022 18:58
Show Gist options
  • Save emersonmx/859de5cb0b93248c8d23d31bf0089fce to your computer and use it in GitHub Desktop.
Save emersonmx/859de5cb0b93248c8d23d31bf0089fce to your computer and use it in GitHub Desktop.
Cookiecutter

Cookiecutter

Git setup

git init example
cd example/
echo "# Example" > README.md
git add .
git commit -m "Start project"

cocu

This is a script to simplify the usage of cookiecutter on current dir. View

Python

Gitignore

curl -fLw '\n' https://www.gitignore.io/api/python > .gitignore
git add .
git commit -m "Add gitignore"

Virtualenv

python -m venv .venv
# or
virtualenv .venv

# with poetry
poetry init
poetry install

# venv activation for pip or for poetry in project venv
source .venv/bin/activate

# venv activation for poetry
poetry shell
# or
source $(poetry env info --path)/bin/activate

Full

cocu python/devdeps
./install_devdeps.py

(cat << EOF
python/pre-commit
python/editorconfig
python/direnv

python/isort
python/black
python/flake8
python/mypy
python/vulture

python/invoke/run
python/invoke/format
python/invoke/lint
python/invoke/tests

python/hello_world
python/tests
EOF
) | xargs -I {} cocu "{}" use_pre_commit=true

pre-commit install

direnv allow .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment