Skip to content

Commit c33efab

Browse files
authored
Migrate to repo-config (#88)
Some of the changes were made in separate commits, but at some point a lot of changes had to be grouped together because they are just too interdependant. * Fix Python header * Update license formatting * Include hidden files in patterns by default * Move security warning * Update URL to avoid ambiguity * Improve labeler configuration * Remove unused labels from keylabeler * Improve wording in release notes and template * Fix typo in release notes and template * Reformat the feature issue template * Update bug issue template * Add cookiecutter replay file to easy upgrading the repo-config templates. * Migrate from `tox` to `nox`. * Move development dependencies to optional dependencies in the `pyproject.toml` file. * Add many other commmon configuration to the `pyproject.toml` file. * Make formatting of markdown files consistent with other projects. * Improve contributing guide with the dev dependencies improvements and to describe how to use `nox` and the docs generation. * Add badges and improve the readme. * Add mkdocs documentation pages and generation. * Improve the CI to match the template, this includes: * Using a new action for protolint that will add inline comments in the PR diffs. * Add support for merge queues. * Use `nox`. * Use the dev dependencies defined in the `pyproject.toml` file. * Add and improve names of steps and jobs. * Remove redundant `with: submodules: true`. * Add jobs for testing and publishing the generated documentation. * Remove the creation of a discussion for each release. * Use `from x import y` instead of `import x.y as y` * Disable import outside toplevel pylint check * Add missing comments to test functions
2 parents 78bb93f + 613f593 commit c33efab

29 files changed

+711
-154
lines changed

.cookiecutter-replay.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"cookiecutter": {
3+
"Introduction": "]\n\nWelcome to repo-config Cookiecutter template!\n\nThis template will help you to create a new repository for your project. You will be asked to provide some information about your project.\n\nHere is an explanation of what each variable is for and will be used for:\n\n* `type`: The type of repository. It must be chosen from the list.\n\n* `name`: The name of the project. This will be used to build defaults for\n other inputs, such as `title`, `python_package`, etc. It should be one word,\n using only alphanumeric characters (and starting with a letter). It can\n include also `_` and `-` which will be handled differently when building\n other variables from it (replaced by spaces in titles for example).\n\n* `description`: A short description of the project. It will be used as the\n description in the `README.md`, `pyproject.toml`, `mkdocs.yml`, etc.\n\n* `title`: A human-readable name or title for the project. It will be used in\n the `README.md`, `CONTRIBUTING.md`, and other files to refer to the project,\n as well as the site title in `mkdocs.yml`.\n\n* `keywords`: A comma-separated list of keywords that will be used in the\n `pyproject.toml` file. If left untouched, it will use only some predefined\n keywords. If anything else is entered, it will be **added** to the default\n keywords.\n\n* `github_org`: The GitHub handle of the organization where the project will\n reside. This will be used to generate links to the project on GitHub.\n\n* `license`: Currently, only two options are provided: `MIT`, which should be\n used for open-source projects, and `Proprietary`, which should be used for\n closed-source projects. This will be added to file headers and used as the\n license in `pyproject.toml`.\n\n* `author_name`, `author_email`: The name and email address of the author of\n the project. They will be used in the copyright notice in file headers and\n as the author in `pyproject.toml`.\n\n* `python_package`: The Python package in which this project will reside. All\n files provided by this project should be located in this package. This needs\n to be a list of valid Python identifiers separated by dots. The source file\n structure will be derived from this. For example, `frequenz.actor.example`\n will generate files in `src/frequenz/actor/example`.\n\n* `pypi_package_name`: The name of the PyPI/wheel/distribution package. This\n should be consistent with the `python_package`, usually replacing `.` with\n `-`. For example, `frequenz-actor-example`.\n\n* `github_repo_name`: The handle of the GitHub repository where the project\n will reside. This will be used to generate links to the project on GitHub and\n as the top-level directory name.\n\n* `default_codeowners`: A space-separated list of GitHub teams (`@org/team`) or\n users (`@user`) that will be the default code owners for this project. This\n will be used to build the `CODEOWNERS` file. Please refer to the [code owners\n documentation] for more details on the valid syntax.\n\n[code owners documentation]: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners\n\n\n[Please press any key to continue",
4+
"type": "api",
5+
"name": "microgrid",
6+
"description": "Frequenz gRPC API for monitoring and control of microgrids",
7+
"title": "Frequenz Microgrid API",
8+
"keywords": "(comma separated: 'frequenz', <type> and <name> are included automatically)",
9+
"github_org": "frequenz-floss",
10+
"license": "MIT",
11+
"author_name": "Frequenz Energy-as-a-Service GmbH",
12+
"author_email": "floss@frequenz.com",
13+
"python_package": "frequenz.api.microgrid",
14+
"pypi_package_name": "frequenz-api-microgrid",
15+
"github_repo_name": "frequenz-api-microgrid",
16+
"default_codeowners": "(like @some-org/some-team; defaults to a team based on the repo type)",
17+
"_extensions": [
18+
"jinja2_time.TimeExtension",
19+
"local_extensions.as_identifier",
20+
"local_extensions.default_codeowners",
21+
"local_extensions.github_repo_name",
22+
"local_extensions.introduction",
23+
"local_extensions.keywords",
24+
"local_extensions.pypi_package_name",
25+
"local_extensions.python_package",
26+
"local_extensions.src_path",
27+
"local_extensions.title"
28+
],
29+
"_template": "gh:frequenz-floss/frequenz-repo-config-python"
30+
}
31+
}

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ name: Report something is not working properly 🐛
55
description:
66
Use this if there is something that is not working properly. If you are not
77
sure or you need help making something work, please ask a question instead.
8-
labels: priority:❓, type:bug
8+
labels:
9+
- "priority:❓"
10+
- "type:bug"
911
body:
1012
- type: markdown
1113
attributes:
@@ -27,21 +29,14 @@ body:
2729
placeholder: What did you expect to happen.
2830
validations:
2931
required: true
30-
- type: dropdown
32+
- type: input
3133
id: version
3234
attributes:
3335
label: Affected version(s)
3436
description:
35-
Which version(s) have you tried and found this issue in? (if you see
36-
this issue **not** happening on any version, please let us know in the
37-
"Extra information").
38-
multiple: true
39-
options:
40-
- I don't know (version:❓)
41-
- An older version (version:old)
42-
- v0.10.x (version:0.10.x)
43-
validations:
44-
required: true
37+
Please add a comma-separated list of the versions affected by this
38+
issue.
39+
placeholder: 'Example: v0.11.0, v0.12.0'
4540
- type: dropdown
4641
id: part
4742
attributes:
@@ -65,6 +60,6 @@ body:
6560
label: Extra information
6661
description:
6762
Please write here any extra information you think it might be relevant,
68-
e.g., if this didn't happened before, or if you suspect where the
69-
problem might be.
63+
e.g., if this didn't happen before, or if you suspect where the problem
64+
might be.
7065
placeholder: Any extra information you think it might be relevant.

.github/ISSUE_TEMPLATE/feature.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33

44
name: Request a feature or enhancement ✨
55
description: Use this if something is missing or could be done better or more easily.
6-
labels: part:❓, priority:❓, type:enhancement
6+
labels:
7+
- "part:❓"
8+
- "priority:❓"
9+
- "type:enhancement"
710
body:
811
- type: markdown
912
attributes:

.github/RELEASE_NOTES.template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Frequenz Migrogrid API Release Notes
1+
# Frequenz Microgrid API Release Notes
22

33
## Summary
44

55
<!-- Here goes a general summary of what this release is about -->
66

77
## Upgrading
88

9-
<!-- Here goes notes on how to upgrade from previous versions, including if there are any deprecations and what they should be replaced with -->
9+
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
1010

1111
## New Features
1212

.github/keylabeler.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,3 @@ labelMappings:
1818
"part:tests": "part:tests"
1919
"part:tooling": "part:tooling"
2020
"part:❓": "part:❓"
21-
"version:old": "version:old"
22-
"version:0.10.x": "version:0.10.x"
23-
"version:❓": "version:❓"

.github/labeler.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@
66
# For more details on the configuration please see:
77
# https://github.com/marketplace/actions/labeler
88

9-
"part:docs":
9+
"part:docs":
1010
- "**/*.md"
11+
- "docs/**"
12+
- "examples/**"
1113
- LICENSE
1214

1315
"part:tests":
1416
- "pytests/**"
1517

1618
"part:tooling":
19+
- "**/*.ini"
20+
- "**/*.toml"
21+
- "**/*.yaml"
22+
- "**/*.yml"
1723
- ".git*"
1824
- ".git*/**"
19-
- "**/*.toml"
20-
- "**/*.ini"
25+
- "docs/*.py"
2126
- CODEOWNERS
2227
- MANIFEST.in
23-
- "*requirements*.txt"
24-
- setup.py
25-
- "submodules/*"
28+
- noxfile.py
2629

2730
"part:python":
2831
- "py/**"

0 commit comments

Comments
 (0)