Skip to content

Commit b48d51b

Browse files
authored
Upgrade to repo-config v0.5.2 (#153)
All the changes are related to regenerating the files using the cookiecutter templates in repo-config v0.5.2. - Remove extensions from replay file - Add empty `Introduction` variable - Bump repo-config version to v0.5.2. - Add common pylint options - Add common source paths for isort - Add editorconfig file - Use repo-config for linting examples in docstrings - ci: Checkout submodules - Add a workflow to make sure release notes are updated - Don't ship development files in the source distribution - Add and sort mkdocs markdown extensions - mkdocs: Add comment with more info about cross-linking - Bump setuptools version
2 parents fbcbe76 + e1e8344 commit b48d51b

File tree

9 files changed

+94
-232
lines changed

9 files changed

+94
-232
lines changed

.cookiecutter-replay.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"cookiecutter": {
3+
"Introduction": "",
34
"type": "lib",
45
"name": "channels",
56
"description": "Channel implementations for Python",
@@ -13,17 +14,6 @@
1314
"pypi_package_name": "frequenz-channels",
1415
"github_repo_name": "frequenz-channels-python",
1516
"default_codeowners": "@frequenz-floss/python-sdk-team",
16-
"_extensions": [
17-
"jinja2_time.TimeExtension",
18-
"local_extensions.default_codeowners",
19-
"local_extensions.github_repo_name",
20-
"local_extensions.keywords",
21-
"local_extensions.pypi_package_name",
22-
"local_extensions.python_package",
23-
"local_extensions.src_path",
24-
"local_extensions.title",
25-
"local_extensions.as_identifier"
26-
],
2717
"_template": "gh:frequenz-floss/frequenz-repo-config-python"
2818
}
2919
}

.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
@@ -13,13 +13,16 @@
1313
- LICENSE
1414

1515
"part:tests":
16+
- "**/conftest.py"
1617
- "tests/**"
1718

1819
"part:tooling":
1920
- "**/*.ini"
2021
- "**/*.toml"
2122
- "**/*.yaml"
2223
- "**/*.yml"
24+
- "**/conftest.py"
25+
- ".editorconfig"
2326
- ".git*"
2427
- ".git*/**"
2528
- "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@v4
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@v4
66+
with:
67+
submodules: true
6468

6569
- name: Set up Python
6670
uses: actions/setup-python@v4
@@ -90,6 +94,8 @@ jobs:
9094
steps:
9195
- name: Fetch sources
9296
uses: actions/checkout@v4
97+
with:
98+
submodules: true
9399

94100
- name: Setup Git user and e-mail
95101
uses: frequenz-floss/setup-git-user@v2
@@ -167,6 +173,8 @@ jobs:
167173
- name: Fetch sources
168174
if: steps.mike-metadata.outputs.version
169175
uses: actions/checkout@v4
176+
with:
177+
submodules: true
170178

171179
- name: Setup Git user and e-mail
172180
if: steps.mike-metadata.outputs.version
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release Notes Check
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
types:
7+
# On by default if you specify no types.
8+
- "opened"
9+
- "reopened"
10+
- "synchronize"
11+
# For `skip-label` only.
12+
- "labeled"
13+
- "unlabeled"
14+
15+
16+
jobs:
17+
check-release-notes:
18+
name: Check release notes are updated
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check for a release notes update
22+
if: github.event_name == 'pull_request'
23+
uses: brettcannon/check-for-changed-files@4170644959a21843b31f1181f2a1761d65ef4791 # v1.2.0
24+
with:
25+
file-pattern: "RELEASE_NOTES.md"
26+
prereq-pattern: "src/**"
27+
skip-label: "cmd:skip-release-notes"
28+
failure-message: "Missing a release notes update. Please add one or apply the ${skip-label} label to the pull request"

MANIFEST.in

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
exclude .gitignore
1+
exclude .cookiecutter-replay.json
22
exclude .darglint
3-
exclude noxfile.py
3+
exclude .editorconfig
4+
exclude .gitignore
45
exclude CODEOWNERS
6+
exclude CONTRIBUTING.md
7+
exclude mkdocs.yml
8+
exclude noxfile.py
9+
exclude src/conftest.py
510
recursive-exclude .github *
6-
recursive-exclude tests *
711
recursive-exclude benchmarks *
12+
recursive-exclude docs *
13+
recursive-exclude tests *
14+
recursive-include py *.pyi

mkdocs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ markdown_extensions:
6868
anchor_linenums: true
6969
line_spans: __span
7070
pygments_lang_class: true
71-
- pymdownx.superfences
72-
- pymdownx.tasklist
73-
- pymdownx.tabbed
7471
- pymdownx.keys
7572
- pymdownx.snippets:
7673
check_paths: true
@@ -79,6 +76,8 @@ markdown_extensions:
7976
- name: mermaid
8077
class: mermaid
8178
format: "!!python/name:pymdownx.superfences.fence_code_format"
79+
- pymdownx.tabbed
80+
- pymdownx.tasklist
8281
- toc:
8382
permalink: "¤"
8483

@@ -104,6 +103,7 @@ plugins:
104103
show_root_members_full_path: true
105104
show_source: true
106105
import:
106+
# See https://mkdocstrings.github.io/python/usage/#import for details
107107
- https://docs.python.org/3/objects.inv
108108
- https://typing-extensions.readthedocs.io/en/stable/objects.inv
109109
- search

pyproject.toml

Lines changed: 10 additions & 9 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

@@ -49,14 +49,14 @@ dev-mkdocs = [
4949
"mkdocs-material == 9.2.8",
5050
"mkdocs-section-index == 0.3.6",
5151
"mkdocstrings[python] == 0.23.0",
52-
"frequenz-repo-config[lib] == 0.4.0",
52+
"frequenz-repo-config[lib] == 0.5.2",
5353
]
5454
dev-mypy = [
5555
"mypy == 1.5.1",
5656
# For checking the noxfile, docs/ script, and tests
5757
"frequenz-channels[dev-mkdocs,dev-noxfile,dev-pytest]",
5858
]
59-
dev-noxfile = ["nox == 2023.4.22", "frequenz-repo-config[lib] == 0.4.0"]
59+
dev-noxfile = ["nox == 2023.4.22", "frequenz-repo-config[lib] == 0.5.2"]
6060
dev-pylint = [
6161
"pylint == 2.17.5",
6262
# For checking the noxfile, docs/ script, and tests
@@ -67,10 +67,8 @@ dev-pytest = [
6767
"async-solipsism == 0.5",
6868
"hypothesis == 6.84.2",
6969
"pytest-asyncio == 0.21.1",
70+
"frequenz-repo-config[extra-lint-examples] == 0.5.2",
7071
"pytest-mock == 3.11.1",
71-
# For checking docs examples
72-
"sybil == 5.0.3",
73-
"pylint == 2.17.5",
7472
]
7573
dev = [
7674
"frequenz-channels[dev-mkdocs,dev-docstrings,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
@@ -90,7 +88,7 @@ include = '\.pyi?$'
9088
[tool.isort]
9189
profile = "black"
9290
line_length = 88
93-
src_paths = ["src", "examples", "tests"]
91+
src_paths = ["benchmarks", "examples", "src", "tests"]
9492

9593
[tool.pylint.similarities]
9694
ignore-comments = ['yes']
@@ -104,10 +102,13 @@ disable = [
104102
# disabled because it conflicts with isort
105103
"wrong-import-order",
106104
"ungrouped-imports",
105+
# pylint's unsubscriptable check is buggy and is not needed because
106+
# it is a type-check, for which we already have mypy.
107+
"unsubscriptable-object",
107108
]
108109

109110
[tool.pytest.ini_options]
110-
testpaths = ["tests", "src"] # src for docs examples
111+
testpaths = ["tests", "src"]
111112
asyncio_mode = "auto"
112113
required_plugins = ["pytest-asyncio", "pytest-mock"]
113114
markers = [

0 commit comments

Comments
 (0)