Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for the v0.11.0 release #333

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,15 @@

## Summary

<!-- Here goes a general summary of what this release is about -->
This version accumulates a few improvements, and bumps the dependency of setuptools to use v75, which is compatible with PEP625, which is necessary to be able to keep uploading to PyPI, so you should upgrade to this version as soon as possible.

The migration script was also rewritten in Python, so it should be more compatible with different OSes.

## Upgrading

- The `frequenz.repo.config.github.abort()` function now takes most arguments as keyword-only arguments.
- The *Queue PRs for v0.x.x* GitHub ruleset was renamed to *Queue PRs for the default branch* and now targets the default branch. It also only have the merge queue restriction, all other restrictions were removed as they are already present in the *Protect version branches* ruleset. You might want to re-import this ruleset to your repositories.

### Cookiecutter template

<!-- Here upgrade steps for cookiecutter specifically -->

## New Features

* Added a new GitHub branch ruleset for Rust projects.
Expand All @@ -33,7 +31,3 @@
## Bug Fixes

* Sybil now parses the `__init__.py` file as well. Previously it was disabled due to an upstream bug.

### Cookiecutter template

<!-- Here bug fixes for cookiecutter specifically -->
36 changes: 36 additions & 0 deletions cookiecutter/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,32 @@ def add_pylint_checks() -> None:
)


def fix_default_fixture_scope() -> None:
"""Fix the default scope of fixtures to 'function'."""
pyproject_toml = Path("pyproject.toml")
print(f"{pyproject_toml}: Fix the default scope of fixtures to 'function'.")
marker = 'asyncio_mode = "auto"\n'
pyproject_toml_content = pyproject_toml.read_text(encoding="utf-8")
if pyproject_toml_content.find(marker) == -1:
manual_step(
f"""\
{pyproject_toml}: We couldn't find the marker {marker!r} in the file.
Please add the following line to the file manually in the
`[tool.pytest.ini_options]` section if it is missing:
asyncio_default_fixture_loop_scope = "function"
"""
)
return

replacement = 'asyncio_default_fixture_loop_scope = "function"\n'
if pyproject_toml_content.find(replacement) >= 0:
print(f"{pyproject_toml}: seems to be already up-to-date.")
return
replace_file_contents_atomically(
pyproject_toml, marker, marker + replacement, content=pyproject_toml_content
)


def main() -> None:
"""Run the migration steps."""
# Dependabot patch
Expand Down Expand Up @@ -177,6 +203,16 @@ def main() -> None:
)
else:
print(f"{dockerfile}: Not found.")
print("=" * 72)

# Make sure `edit_uri` points to the default branch
manual_step(
"Make sure that the `edit_uri` in the `mkdocs.yml` file points to the default branch."
)
print("=" * 72)

# Fix the default scope of fixtures to 'function'
fix_default_fixture_scope()

# Add a separation line like this one after each migration step.
print("=" * 72)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
requires = [
"setuptools == 75.5.0",
"setuptools_scm[toml] == 8.1.0",
"frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0",
"frequenz-repo-config[{{cookiecutter.type}}] == 0.11.0",
{%- if cookiecutter.type == "api" %}
# We need to pin the protobuf, grpcio and grpcio-tools dependencies to make
# sure the code is generated using the minimum supported versions, as older
Expand Down Expand Up @@ -101,7 +101,7 @@ dev-mkdocs = [
"mkdocs-material == 9.5.45",
"mkdocstrings[python] == 0.27.0",
"mkdocstrings-python == 1.12.2",
"frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0",
"frequenz-repo-config[{{cookiecutter.type}}] == 0.11.0",
]
dev-mypy = [
"mypy == 1.9.0",
Expand All @@ -114,7 +114,7 @@ dev-mypy = [
]
dev-noxfile = [
"nox == 2024.10.9",
"frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0",
"frequenz-repo-config[{{cookiecutter.type}}] == 0.11.0",
]
dev-pylint = [
# dev-pytest already defines a dependency to pylint because of the examples
Expand All @@ -124,7 +124,7 @@ dev-pylint = [
dev-pytest = [
"pytest == 8.3.3",
"pylint == 3.3.1", # We need this to check for the examples
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
{%- if cookiecutter.type != "api" %}
"pytest-mock == 3.14.0",
"pytest-asyncio == 0.24.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
requires = [
"setuptools == 75.5.0",
"setuptools_scm[toml] == 8.1.0",
"frequenz-repo-config[actor] == 0.10.0",
"frequenz-repo-config[actor] == 0.11.0",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -60,7 +60,7 @@ dev-mkdocs = [
"mkdocs-material == 9.5.45",
"mkdocstrings[python] == 0.27.0",
"mkdocstrings-python == 1.12.2",
"frequenz-repo-config[actor] == 0.10.0",
"frequenz-repo-config[actor] == 0.11.0",
]
dev-mypy = [
"mypy == 1.9.0",
Expand All @@ -70,7 +70,7 @@ dev-mypy = [
]
dev-noxfile = [
"nox == 2024.10.9",
"frequenz-repo-config[actor] == 0.10.0",
"frequenz-repo-config[actor] == 0.11.0",
]
dev-pylint = [
# dev-pytest already defines a dependency to pylint because of the examples
Expand All @@ -80,7 +80,7 @@ dev-pylint = [
dev-pytest = [
"pytest == 8.3.3",
"pylint == 3.3.1", # We need this to check for the examples
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
"pytest-mock == 3.14.0",
"pytest-asyncio == 0.24.0",
"async-solipsism == 0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
requires = [
"setuptools == 75.5.0",
"setuptools_scm[toml] == 8.1.0",
"frequenz-repo-config[api] == 0.10.0",
"frequenz-repo-config[api] == 0.11.0",
# We need to pin the protobuf, grpcio and grpcio-tools dependencies to make
# sure the code is generated using the minimum supported versions, as older
# versions can't work with code that was generated with newer versions.
Expand Down Expand Up @@ -71,7 +71,7 @@ dev-mkdocs = [
"mkdocs-material == 9.5.45",
"mkdocstrings[python] == 0.27.0",
"mkdocstrings-python == 1.12.2",
"frequenz-repo-config[api] == 0.10.0",
"frequenz-repo-config[api] == 0.11.0",
]
dev-mypy = [
"mypy == 1.9.0",
Expand All @@ -82,7 +82,7 @@ dev-mypy = [
]
dev-noxfile = [
"nox == 2024.10.9",
"frequenz-repo-config[api] == 0.10.0",
"frequenz-repo-config[api] == 0.11.0",
]
dev-pylint = [
# dev-pytest already defines a dependency to pylint because of the examples
Expand All @@ -92,7 +92,7 @@ dev-pylint = [
dev-pytest = [
"pytest == 8.3.3",
"pylint == 3.3.1", # We need this to check for the examples
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
]
dev = [
"frequenz-api-test[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
requires = [
"setuptools == 75.5.0",
"setuptools_scm[toml] == 8.1.0",
"frequenz-repo-config[app] == 0.10.0",
"frequenz-repo-config[app] == 0.11.0",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -59,7 +59,7 @@ dev-mkdocs = [
"mkdocs-material == 9.5.45",
"mkdocstrings[python] == 0.27.0",
"mkdocstrings-python == 1.12.2",
"frequenz-repo-config[app] == 0.10.0",
"frequenz-repo-config[app] == 0.11.0",
]
dev-mypy = [
"mypy == 1.9.0",
Expand All @@ -69,7 +69,7 @@ dev-mypy = [
]
dev-noxfile = [
"nox == 2024.10.9",
"frequenz-repo-config[app] == 0.10.0",
"frequenz-repo-config[app] == 0.11.0",
]
dev-pylint = [
# dev-pytest already defines a dependency to pylint because of the examples
Expand All @@ -79,7 +79,7 @@ dev-pylint = [
dev-pytest = [
"pytest == 8.3.3",
"pylint == 3.3.1", # We need this to check for the examples
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
"pytest-mock == 3.14.0",
"pytest-asyncio == 0.24.0",
"async-solipsism == 0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
requires = [
"setuptools == 75.5.0",
"setuptools_scm[toml] == 8.1.0",
"frequenz-repo-config[lib] == 0.10.0",
"frequenz-repo-config[lib] == 0.11.0",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -56,7 +56,7 @@ dev-mkdocs = [
"mkdocs-material == 9.5.45",
"mkdocstrings[python] == 0.27.0",
"mkdocstrings-python == 1.12.2",
"frequenz-repo-config[lib] == 0.10.0",
"frequenz-repo-config[lib] == 0.11.0",
]
dev-mypy = [
"mypy == 1.9.0",
Expand All @@ -66,7 +66,7 @@ dev-mypy = [
]
dev-noxfile = [
"nox == 2024.10.9",
"frequenz-repo-config[lib] == 0.10.0",
"frequenz-repo-config[lib] == 0.11.0",
]
dev-pylint = [
# dev-pytest already defines a dependency to pylint because of the examples
Expand All @@ -76,7 +76,7 @@ dev-pylint = [
dev-pytest = [
"pytest == 8.3.3",
"pylint == 3.3.1", # We need this to check for the examples
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
"pytest-mock == 3.14.0",
"pytest-asyncio == 0.24.0",
"async-solipsism == 0.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
requires = [
"setuptools == 75.5.0",
"setuptools_scm[toml] == 8.1.0",
"frequenz-repo-config[model] == 0.10.0",
"frequenz-repo-config[model] == 0.11.0",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -60,7 +60,7 @@ dev-mkdocs = [
"mkdocs-material == 9.5.45",
"mkdocstrings[python] == 0.27.0",
"mkdocstrings-python == 1.12.2",
"frequenz-repo-config[model] == 0.10.0",
"frequenz-repo-config[model] == 0.11.0",
]
dev-mypy = [
"mypy == 1.9.0",
Expand All @@ -70,7 +70,7 @@ dev-mypy = [
]
dev-noxfile = [
"nox == 2024.10.9",
"frequenz-repo-config[model] == 0.10.0",
"frequenz-repo-config[model] == 0.11.0",
]
dev-pylint = [
# dev-pytest already defines a dependency to pylint because of the examples
Expand All @@ -80,7 +80,7 @@ dev-pylint = [
dev-pytest = [
"pytest == 8.3.3",
"pylint == 3.3.1", # We need this to check for the examples
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
"pytest-mock == 3.14.0",
"pytest-asyncio == 0.24.0",
"async-solipsism == 0.6",
Expand Down