![]() |
![]() |
|---|---|
| Screenshot 1 | Screenshot 2 |
python-boilerplate is a template repository for using Docker & Python.
- Replace the string
shin-sforzandowith the actual project owner - Replace the string
python-boilerplatewith the actual project name - Create an issue
#1for screenshots -
lefthook installto install git hooks - Check the repository secrets
-
git secret remove dev@sforzando.co.jp.ascto delete it - Set
SCORECARD_READ_TOKENfor OpenSSF - Set
CODECOV_TOKENof this repository if it's private - Check
codecovstep in.github/workflows/ci.ymlif it's private
-
- Prepare GitHub Pages
- Arrange
sider.ymlto match the project - Delete
.github/workflows/codeql-analysis.ymlif it's private - Submit OpenSSF Best Practices Badge Program
- Integrate with Slack:
/github subscribe shin-sforzando/python-boilerplate reviews comments branches commits:* - Delete this section!
%%{init: {'theme': 'neutral' } }%%
graph LR
subgraph D[Docker]
P(Python)
end
- Docker as Environment Isolator
- Python (Version 3.10 or higher)
- secretlint as Credential Linter
- Lefthook as Git Hooks Manager
- git-secret as Secret File Manager
- direnv as
.envLoader
$ make help
default 常用
init 初期
ps 状況
build 構築
up 起動
renew 転生
shell 接続
logs 記録
follow 追跡
open 閲覧
hide 秘匿
reveal 暴露
start 開始
format 整形
lint 検証
test 試験
pytest 試験
doc 文書
sphinx 文書
deploy 配備
stop 停止
down 削除
clean 掃除
prune 破滅
help 助言To install some development commands, run below.
make initTo install git-secret via Homebrew manually, brew install git-secret.
To install direnv via Homebrew manually, brew install direnv.
Developers who share a GPG key with their team can decrypt confidential information.
To reveal the secret information (= *.secrets), run below.
make revealIf there are .env -like files included in *.secrets, direnv try to load them automatically.
direnv allow to approve it.
On the other hand, to encrypt the updated secret information, run below.
make hideTo install Lefthook via Homebrew, brew install lefthook.
lefthook installThereafter, each commit will validate by make format and make lint, and each push will validate by make test and secretlint.
Commands that are often used during development should be prepared in default.
makeMake sure there is .env like below before starting development.
DEBUG=TrueUsually, .env is prepared by Reveal Secrets action.
Don't forget that it needs to run direnv allow every time the .env is changed.
docker-compose automatically loads .env at build.
To apply even inside the Docker container, use env_files in docker-compose.yml.
If it succeeds, http.server will start waiting on http://0.0.0.0:8000/.
To check this address, run below.
make openTo view container's log, run one of the following commands.
make logs # View last output from containers.
make follow # Follow outputs from containers.To connect app container using Bash, run below.
make bashTo format Python source codes using Black manually, run below.
make formatTo lint Python source codes using flake8 manually, run below.
make lintTo test Python source codes using pytest manually, run below.
make testWhen the main branch is updated, pages.yml will update the API Document.
To generate API Documents using Sphinx manually, run below.
make docTo install git-cliff via Homebrew manually, brew install git-cliff.
To update CHANGELOG.md manually, run git-cliff like below.
git cliff --output CHANGELOG.mdTo deploy this to (T. B. D.) manually, run below.
make deployTo clean up miscellaneous files, run below.
make cleanThis repository is Commitizen friendly, following GitHub flow. See CONTRIBUTING.md for details.
See LICENSE.

