Skip to content

Commit 953e320

Browse files
authored
Upgrade to repo-config v0.5.2 (#587)
All changes here are derived from regenerating files using the templates in repo-config v0.5.2.
2 parents 1f5aa39 + 9022629 commit 953e320

File tree

10 files changed

+71
-255
lines changed

10 files changed

+71
-255
lines changed

.cookiecutter-replay.json

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"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",
3+
"Introduction": "",
44
"type": "lib",
55
"name": "sdk",
66
"description": "A development kit to interact with the Frequenz development platform",
@@ -14,43 +14,6 @@
1414
"pypi_package_name": "frequenz-sdk",
1515
"github_repo_name": "frequenz-sdk-python",
1616
"default_codeowners": "@frequenz-floss/python-sdk-team",
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-
"_cookiecutter": {
32-
"Introduction": "{{cookiecutter | introduction}}",
33-
"type": [
34-
"actor",
35-
"api",
36-
"app",
37-
"lib",
38-
"model"
39-
],
40-
"name": null,
41-
"description": null,
42-
"title": "{{cookiecutter | title}}",
43-
"keywords": "(comma separated: 'frequenz', <type> and <name> are included automatically)",
44-
"github_org": "frequenz-floss",
45-
"license": [
46-
"MIT",
47-
"Proprietary"
48-
],
49-
"author_name": "Frequenz Energy-as-a-Service GmbH",
50-
"author_email": "[email protected]",
51-
"python_package": "{{cookiecutter | python_package}}",
52-
"pypi_package_name": "{{cookiecutter | pypi_package_name}}",
53-
"github_repo_name": "{{cookiecutter | github_repo_name}}",
54-
"default_codeowners": "(like @some-org/some-team; defaults to a team based on the repo type)"
17+
"_template": "gh:frequenz-floss/frequenz-repo-config-python"
5518
}
56-
}
19+
}

.editorconfig

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Set default charset, indent style and trimming of whitespace
12+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,md,proto,py,pyi,toml,yaml,yml}}]
13+
charset = utf-8
14+
indent_style = space
15+
trim_trailing_whitespace = true
16+
17+
# 4 space indentation
18+
[*.{py,pyi}]
19+
indent_size = 4
20+
21+
# 2 space indentation
22+
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,proto,toml,yaml,yml}}]
23+
indent_size = 2
24+
25+
# No indentation size specified for *.md because different blocks have
26+
# different indentation rules

.github/labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@
3333
- "src/frequenz/sdk/power/**"
3434

3535
"part:tests":
36+
- "**/conftest.py"
3637
- "tests/**"
3738

3839
"part:tooling":
3940
- "**/*.ini"
4041
- "**/*.toml"
4142
- "**/*.yaml"
4243
- "**/*.yml"
44+
- "**/conftest.py"
45+
- ".editorconfig"
4346
- ".git*"
4447
- ".git*/**"
4548
- "docs/*.py"

.github/workflows/ci.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737
steps:
3838
- name: Fetch sources
3939
uses: actions/checkout@v3
40+
with:
41+
submodules: true
4042

4143
- name: Set up Python
4244
uses: actions/setup-python@v4
@@ -61,6 +63,8 @@ jobs:
6163
steps:
6264
- name: Fetch sources
6365
uses: actions/checkout@v3
66+
with:
67+
submodules: true
6468

6569
- name: Set up Python
6670
uses: actions/setup-python@v4
@@ -115,6 +119,8 @@ jobs:
115119
steps:
116120
- name: Fetch sources
117121
uses: actions/checkout@v3
122+
with:
123+
submodules: true
118124

119125
- name: Setup Git user and e-mail
120126
uses: frequenz-floss/setup-git-user@v2
@@ -192,6 +198,8 @@ jobs:
192198
- name: Fetch sources
193199
if: steps.mike-metadata.outputs.version
194200
uses: actions/checkout@v3
201+
with:
202+
submodules: true
195203

196204
- name: Setup Git user and e-mail
197205
if: steps.mike-metadata.outputs.version

.github/workflows/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ jobs:
2121
uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # 4.3.0
2222
with:
2323
repo-token: "${{ secrets.GITHUB_TOKEN }}"
24+
dot: true
File renamed without changes.

MANIFEST.in

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
exclude .cookiecutter-replay.json
12
exclude .darglint
3+
exclude .editorconfig
24
exclude .gitignore
35
exclude CODEOWNERS
4-
exclude minimum-requirements-ci.txt
6+
exclude CONTRIBUTING.md
7+
exclude mkdocs.yml
58
exclude noxfile.py
9+
exclude src/conftest.py
610
recursive-exclude .github *
7-
recursive-exclude benchmarks *
8-
recursive-exclude examples *
11+
recursive-exclude docs *
912
recursive-exclude tests *
13+
recursive-include py *.pyi

noxfile.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
"""Configuration file for nox."""
55

6-
from frequenz.repo.config import RepositoryType, nox
6+
from frequenz.repo.config import nox
7+
from frequenz.repo.config.nox import default
78

8-
nox.configure(RepositoryType.LIB)
9+
config = default.lib_config.copy()
10+
config.opts.mypy = [] # Set in pyproject.toml
11+
12+
nox.configure(config)

pyproject.toml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
[build-system]
55
requires = [
6-
"setuptools == 67.7.2",
6+
"setuptools == 68.1.0",
77
"setuptools_scm[toml] == 7.1.0",
8-
"frequenz-repo-config[lib] == 0.4.0",
8+
"frequenz-repo-config[lib] == 0.5.2",
99
]
1010
build-backend = "setuptools.build_meta"
1111

@@ -63,7 +63,7 @@ dev-mkdocs = [
6363
"mkdocs-material == 9.2.5",
6464
"mkdocs-section-index == 0.3.5",
6565
"mkdocstrings[python] == 0.22.0",
66-
"frequenz-repo-config[lib] == 0.4.0",
66+
"frequenz-repo-config[lib] == 0.5.2",
6767
]
6868
dev-mypy = [
6969
"mypy == 1.5.1",
@@ -72,14 +72,15 @@ dev-mypy = [
7272
# For checking the noxfile, docs/ script, and tests
7373
"frequenz-sdk[dev-mkdocs,dev-noxfile,dev-pytest]",
7474
]
75-
dev-noxfile = ["nox == 2023.4.22", "frequenz-repo-config[lib] == 0.4.0"]
75+
dev-noxfile = ["nox == 2023.4.22", "frequenz-repo-config[lib] == 0.5.2"]
7676
dev-pylint = [
7777
"pylint == 2.17.5",
7878
# For checking the noxfile, docs/ script, and tests
7979
"frequenz-sdk[dev-mkdocs,dev-noxfile,dev-pytest]",
8080
]
8181
dev-pytest = [
8282
"pytest == 7.4.0",
83+
"frequenz-repo-config[extra-lint-examples] == 0.5.2",
8384
"pytest-mock == 3.11.1",
8485
"pytest-asyncio == 0.21.1",
8586
"time-machine == 2.12.0",
@@ -134,6 +135,13 @@ testpaths = ["tests", "src"]
134135
asyncio_mode = "auto"
135136
required_plugins = ["pytest-asyncio", "pytest-mock"]
136137

138+
[tool.mypy]
139+
explicit_package_bases = true
140+
namespace_packages = true
141+
no_incremental = true
142+
packages = ["frequenz.sdk"]
143+
strict = true
144+
137145
[[tool.mypy.overrides]]
138146
module = [
139147
"async_solipsism",

0 commit comments

Comments
 (0)