pypa-hatch/docs/config/project-templates.md

1.6 KiB

Project templates


You can control how new projects are created by the new command using Hatch's config file.

Author

=== ":octicons-file-code-16: config.toml"

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

Licenses

=== ":octicons-file-code-16: config.toml"

```toml
[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.

Options

Tests

This adds a tests directory with pytest functionality.

=== ":octicons-file-code-16: config.toml"

```toml
[template.plugins.default]
tests = true
```

CI

This adds a GitHub Actions workflow that runs tests on all platforms using modern versions of Python.

=== ":octicons-file-code-16: config.toml"

```toml
[template.plugins.default]
ci = false
```

src layout

See this blog post.

=== ":octicons-file-code-16: config.toml"

```toml
[template.plugins.default]
src-layout = false
```

Feature flags

Command line interface

The --cli flag adds a CLI backed by Click that can also be invoked with python -m <PKG_NAME>.