Included in this boilerplate:
- pyenv for python version management
- poetry for dependency management integrated with pyenv
- pre-commit for linting and formatting
- pytest for testing
- black for formatting
- flake8 for linting
- isort for sorting imports
- mypy for static type checking
- virtualenv created by poetry resides in
.venv
folder
- Make sure you have python required interpreter installed in pyenv e.g.
- Rename project:
-
Rename app folder to your app name if needed (
mv app_name new_app_name
) and then:find ./ -type f -not -path "./.git/*" -exec sed -i 's/app_name/new_app_name/g' {} \; find ./ -type f -not -path "./.git/*" -exec sed -i 's/app-name/new-app-name/g' {} \;
-
or use
make rename-project NEW_APP_NAME=new_app_name
to do it for you
make install
make test
- Make sure it's working:
poetry run app-cli "Developer"
- Optionally, squeeze history into one commit:
git reset $(git commit-tree HEAD^{tree} -m "Initial commit")
- Check current poetry virtualenv and change it
$ poetry env info
$ poetry env list
$ poetry env remove /home/PATH/bin/python
$ make install
- Cherry-pick commit from repository cloned from this one:
$ git remote add projectB /home/you/projectB
$ git fetch projectB
$ git cherry-pick <commit from projectB repo>