|
| 1 | +_subdirectory: template |
| 2 | + |
| 3 | +project_name: |
| 4 | + type: str |
| 5 | + help: What is the name of your project? |
| 6 | + placeholder: Sample Project |
| 7 | + expected: Title case string, can contain spaces |
| 8 | + explanation: | |
| 9 | + The project name will be used to propose a suitable package name and [Remote Url][remote-url]. |
| 10 | + It is also repeated in multiple places (Python package configuration, documentation, etc.). |
| 11 | +
|
| 12 | +package_name: |
| 13 | + type: str |
| 14 | + help: What is the name of your Python package? |
| 15 | + default: "{{ project_name|lower|replace(' ', '_')|replace('-', '_') }}" |
| 16 | + expected: Lowercase string, can contain underscores |
| 17 | + explanation: | |
| 18 | + This is the name of your Python package. As such, it will be used as the name of the directory containing your code. |
| 19 | + All imports of your package start with this name. |
| 20 | +
|
| 21 | + Example: If you choose `sample_project` as your package name, your code files would be created in |
| 22 | +
|
| 23 | + ``` |
| 24 | + ./ |
| 25 | + ├── src |
| 26 | + │ └── sample_project |
| 27 | + │ ├── __init__.py |
| 28 | + │ ├── __main__.py |
| 29 | + │ └── some_module.py |
| 30 | + ├── pyproject.toml |
| 31 | + └── ... |
| 32 | + ``` |
| 33 | +
|
| 34 | + and your imports would look like this: |
| 35 | +
|
| 36 | + ```python |
| 37 | + from sample_project import some_module |
| 38 | + ``` |
| 39 | +
|
| 40 | + You might want to consult [PEP 423 – Naming conventions and recipes related to packaging](https://peps.python.org/pep-0423/) |
| 41 | + for guidance on Python package name conventions. |
| 42 | +
|
| 43 | + The cli command included with this template will be named after your package, only with dashes instead of underscores. |
| 44 | + Following the example above, your cli would then be available as |
| 45 | +
|
| 46 | + ```console |
| 47 | + $ sample-project --help |
| 48 | + ``` |
| 49 | +
|
| 50 | + If you ever want to publish your Python package to [PyPI](https://pypi.org), the package name has to be unique to be accepted there. |
| 51 | +
|
| 52 | + Finally, the package name is repeated across multiple configuration and documentation files. |
| 53 | +
|
| 54 | +use_precommit: |
| 55 | + type: bool |
| 56 | + default: true |
| 57 | + help: Use pre-commit to run checks on each commit? |
| 58 | + explanation: | |
| 59 | + [pre-commit](../reference/tooling/pre-commit.md) is a tool that makes configuring [git hooks][git-hooks] a lot easier. |
| 60 | +
|
| 61 | + This template uses pre-commit hooks to ensure, all changes match the expected formatting and style. |
| 62 | + Additionally, running linters at this stage can prevent committing something that contains obvious issues. |
| 63 | +
|
| 64 | + Most formatters and some linters are able to fix issues automatically. |
| 65 | + So you can simply review the changes those tools made, stage them and commit again. |
| 66 | +
|
| 67 | +use_bumpversion: |
| 68 | + type: bool |
| 69 | + default: false |
| 70 | + help: Use bumpversion to manage semantic version across multiple files? |
| 71 | + explanation: | |
| 72 | + If you want to version your project, [bumpversion][] provides an easy way to increase version numbers across multiple files. |
| 73 | +
|
| 74 | + It integrates with git and helps with your release workflow by automating version bump, commit and tag creation. |
| 75 | + Used correctly, releasing a new version of your project can be done with a single command. |
| 76 | +
|
| 77 | + It also helps to follow [semantic versioning][semantic-versioning] guidelines when increasing your version numbers. |
| 78 | +
|
| 79 | +docs: |
| 80 | + type: str |
| 81 | + choices: |
| 82 | + Material for MkDocs: mkdocs |
| 83 | + Sphinx: sphinx |
| 84 | + None: none |
| 85 | + default: "mkdocs" |
| 86 | + help: Which documentation tool do you want to use? |
| 87 | + explanation: | |
| 88 | + [Documentation][documentation] is an important part of any project. |
| 89 | +
|
| 90 | + So far, this template supports two documentation tools: [MkDocs][mkdocs] and [Sphinx][sphinx]. |
| 91 | +
|
| 92 | + [MkDocs][mkdocs] is a great documentation tool built around [Markdown][markdown]. |
| 93 | + It is easy to use and produces a great looking documentation website with minimal overhead and configuration. |
| 94 | +
|
| 95 | + [Sphinx][sphinx] is a powerful tool for documentation written in [Markdown][markdown] or [reStructuredText][restructuredtext]. |
| 96 | + With the [`myst_parser`][myst_parser] it is now (almost) possible to rely on Markdown only. |
| 97 | + Choose this if you want to publish your documentation in multiple formats (e.g. PDF, HTML, ePub, ...). |
| 98 | +
|
| 99 | + If you are not sure which one to use, simply go with the default 😉. |
| 100 | +
|
| 101 | +remote: |
| 102 | + choices: |
| 103 | + GitHub: github |
| 104 | + FHG Gitlab: gitlab-fhg |
| 105 | + IIS Gitlab: gitlab-iis |
| 106 | + help: Which platform will your project be hosted on? |
| 107 | + default: "github" |
| 108 | + explanation: | |
| 109 | + This template provides a CI configuration for either GitHub (Github Actions) or GitLab (Gitlab CI). |
| 110 | +
|
| 111 | + Also, the link to your documentation depends on which remote you choose. |
| 112 | +
|
| 113 | + If you want to push your project to multiple remotes, you can add them later. |
| 114 | +
|
| 115 | +user_name: |
| 116 | + type: str |
| 117 | + help: User name (the one you used with your hosted git provider) |
| 118 | + explanation: | |
| 119 | + This is the user name you are using with the remote provider you provided in the previous question. |
| 120 | +
|
| 121 | + Together with [remote][], it will be used to suggest a [remote url][remote-url] for your project. |
| 122 | +
|
| 123 | +remote_url: |
| 124 | + type: str |
| 125 | + help: URL of the remote repository |
| 126 | + default: git@{% if remote=='github' %}github.com{% elif remote=='gitlab-iis' %}git01.iis.fhg.de{% elif remote=='gitlab-fhg' %}gitlab.cc-asp.fraunhofer.de{% endif %}:{{user_name}}/{{project_name | lower | replace(' ', '-')}}.git |
| 127 | + expected: SSH URL to your remote repository |
| 128 | + explanation: | |
| 129 | + Apart from configuring the git remote for you, the remote URL is required to determine other values, such as |
| 130 | +
|
| 131 | + - Links in your README and CHANGELOG files |
| 132 | + - Links to your documentation |
| 133 | + - Link to your repository from your documentation |
| 134 | + - ... |
| 135 | +
|
| 136 | + If you did not create your remote repository yet (i.e. new project at GitHub or Gitlab), this might be a good time to do so. |
| 137 | +
|
| 138 | + !!! tip "Create empty repository" |
| 139 | +
|
| 140 | + Do not initialize your remote project with a LICENSE or README file. |
| 141 | + This will let you push your initial commit without merge or rebase. |
| 142 | +
|
| 143 | + === "Gitlab" |
| 144 | +
|
| 145 | +  |
| 146 | + *The SSH URL to your Gitlab repository can be found under the `Clone` dropdown (screenshot taken 23.08.23)*{.caption} |
| 147 | +
|
| 148 | +
|
| 149 | + === "GitHub" |
| 150 | +
|
| 151 | +  |
| 152 | + *The SSH URL to your GitHub repository can be found under the `<> Code` dropdown menu (screenshot taken 23.08.23)*{.caption} |
| 153 | +
|
| 154 | +default_branch: |
| 155 | + type: str |
| 156 | + default: main |
| 157 | + help: Name of the initial git branch that will be created |
| 158 | + expected: Lowercase string, can contain dashes |
| 159 | + examples: [main, master, dev] |
| 160 | + explanation: | |
| 161 | + Name of the [initial branch][] of your new project. |
| 162 | +
|
| 163 | + This branch traditionally was called `master`, but is more often called `main` now. |
| 164 | +
|
| 165 | + [initial branch]: https://git-scm.com/docs/git-init#Documentation/git-init.txt---initial-branchltbranch-namegt |
| 166 | +_tasks: |
| 167 | + - "rm -rf context" |
| 168 | + - "git init --initial-branch={{default_branch}}" |
| 169 | + - "git remote add origin {{remote_url}} || true" |
| 170 | + - "{% if use_precommit %}pre-commit install || echo 'Error during installation of pre-commit hooks. Is pre-commit installed?'{% endif %}" |
0 commit comments