Skip to content

Project templatesプロジェクトテンプレート


You can control how new projects are created by the new command using Hatch's config file.Hatchのconfig fileを使用して、newコマンドによって新しいプロジェクトの作成方法を制御できます。

Author著者

[template]
name = "..."
email = "..."

Licensesライセンス

[template.licenses]
headers = true
default = [
  "MIT",
]

The list of licenses should be composed of SPDX identifiers. If multiple licenses are specified, then they will be placed in a LICENSES directory.ライセンスのリストは、SPDX identifiersで構成されるべきです。複数のライセンスが指定されている場合、それらはLICENSESディレクトリに配置されます。

Optionsオプション

Testsテスト

This adds a tests directory with environments for testing and linting.これにより、テストとリンティング用の環境を持つtestsディレクトリが追加されます。

[template.plugins.default]
tests = true

CICI

This adds a GitHub Actions workflow that runs tests on all platforms using modern versions of Python.これにより、最新のPythonバージョンを使用してすべてのプラットフォームでテストを実行するGitHub Actions workflowが追加されます。

[template.plugins.default]
ci = false

src layoutsrc レイアウト

See this blog post.このブログ記事を参照してください。

[template.plugins.default]
src-layout = true

Feature flagsフィーチャーフラグ

Command line interfaceコマンドラインインターフェース

The --cli flag adds a CLI backed by Click that can also be invoked with python -m <PKG_NAME>.--cli フラグは、Click に基づいたCLIを追加し、python -m <PKG_NAME> で呼び出すこともできます。