Skip to content
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
17 changes: 9 additions & 8 deletions brand/build/projects.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from collections.abc import Callable
from html import escape
from pathlib import Path

from brand.build import geometry as g
Expand Down Expand Up @@ -165,13 +166,13 @@ def wrap_text(text: str, size: float, max_w: float) -> list[str]:


DOCS_REPOS: dict[str, str] = {
"modern-di": "powerful DI framework with scopes",
"that-depends": "predecessor DI framework, still actively maintained",
"lite-bootstrap": "lightweight package for bootstrapping new microservices",
"httpware": "HTTP client framework with sync/async clients, middleware chain, and built-in resilience (retry, bulkhead)",
"faststream-redis-timers": "FastStream broker integration for Redis-backed distributed timer scheduling",
"faststream-outbox": "FastStream broker integration for the transactional outbox pattern with Postgres",
"semvertag": "auto-tag your GitHub/GitLab repo with semantic version tags from CI",
"modern-di": "Powerful dependency-injection framework with IoC container and scopes",
"that-depends": "Simple, typed dependency-injection framework for Python",
"lite-bootstrap": "Lightweight bootstrap for production-ready Python microservices",
"httpware": "Typed, resilient HTTP clients for Python, sync and async",
"faststream-redis-timers": "FastStream integration for Redis-backed distributed timer scheduling",
"faststream-outbox": "FastStream transactional-outbox integration backed by a Postgres table",
"semvertag": "Auto-tag GitHub & GitLab repos with semantic version tags from CI",
}

_CARD_W = 1280
Expand Down Expand Up @@ -228,6 +229,6 @@ def project_social_card(repo: str, *, tagline: str) -> str:
)
return (
f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {_CARD_W} {_CARD_H}" '
f'role="img" aria-label="{repo} — {tagline}">'
f'role="img" aria-label="{repo}: {escape(tagline)}">'
f"{panels}{mark}{name_svg}{tag_svg}{url_svg}</svg>"
)
Binary file modified brand/projects/faststream-outbox/social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion brand/projects/faststream-outbox/social-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified brand/projects/faststream-redis-timers/social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion brand/projects/faststream-redis-timers/social-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified brand/projects/httpware/social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion brand/projects/httpware/social-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified brand/projects/lite-bootstrap/social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion brand/projects/lite-bootstrap/social-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified brand/projects/modern-di/social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion brand/projects/modern-di/social-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified brand/projects/semvertag/social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion brand/projects/semvertag/social-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified brand/projects/that-depends/social-card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion brand/projects/that-depends/social-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Every project is built with the same tooling
- [`modern-di-flask`](https://github.com/modern-python/modern-di-flask): modern-di integration for Flask
- [`modern-di-grpc`](https://github.com/modern-python/modern-di-grpc): modern-di integration for gRPC
- [`modern-di-litestar`](https://github.com/modern-python/modern-di-litestar): modern-di integration for Litestar
- [`modern-di-pytest`](https://github.com/modern-python/modern-di-pytest): Pytest integration for modern-di — turn DI dependencies into fixtures
- [`modern-di-pytest`](https://github.com/modern-python/modern-di-pytest): Pytest integration for modern-di that turns DI dependencies into fixtures
- [`modern-di-starlette`](https://github.com/modern-python/modern-di-starlette): modern-di integration for Starlette
- [`modern-di-taskiq`](https://github.com/modern-python/modern-di-taskiq): modern-di integration for taskiq
- [`modern-di-typer`](https://github.com/modern-python/modern-di-typer): modern-di integration for Typer
Expand Down
2 changes: 1 addition & 1 deletion profile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Open-source templates and libraries for building production-ready Python applica
| [`modern-di-flask`](https://github.com/modern-python/modern-di-flask) | modern-di integration for Flask | [![Stars](https://img.shields.io/github/stars/modern-python/modern-di-flask)](https://github.com/modern-python/modern-di-flask/stargazers) | [![Downloads](https://static.pepy.tech/badge/modern-di-flask/month)](https://pepy.tech/projects/modern-di-flask) |
| [`modern-di-grpc`](https://github.com/modern-python/modern-di-grpc) | modern-di integration for gRPC | [![Stars](https://img.shields.io/github/stars/modern-python/modern-di-grpc)](https://github.com/modern-python/modern-di-grpc/stargazers) | [![Downloads](https://static.pepy.tech/badge/modern-di-grpc/month)](https://pepy.tech/projects/modern-di-grpc) |
| [`modern-di-litestar`](https://github.com/modern-python/modern-di-litestar) | modern-di integration for Litestar | [![Stars](https://img.shields.io/github/stars/modern-python/modern-di-litestar)](https://github.com/modern-python/modern-di-litestar/stargazers) | [![Downloads](https://static.pepy.tech/badge/modern-di-litestar/month)](https://pepy.tech/projects/modern-di-litestar) |
| [`modern-di-pytest`](https://github.com/modern-python/modern-di-pytest) | Pytest integration for modern-di — turn DI dependencies into fixtures | [![Stars](https://img.shields.io/github/stars/modern-python/modern-di-pytest)](https://github.com/modern-python/modern-di-pytest/stargazers) | [![Downloads](https://static.pepy.tech/badge/modern-di-pytest/month)](https://pepy.tech/projects/modern-di-pytest) |
| [`modern-di-pytest`](https://github.com/modern-python/modern-di-pytest) | Pytest integration for modern-di that turns DI dependencies into fixtures | [![Stars](https://img.shields.io/github/stars/modern-python/modern-di-pytest)](https://github.com/modern-python/modern-di-pytest/stargazers) | [![Downloads](https://static.pepy.tech/badge/modern-di-pytest/month)](https://pepy.tech/projects/modern-di-pytest) |
| [`modern-di-starlette`](https://github.com/modern-python/modern-di-starlette) | modern-di integration for Starlette | [![Stars](https://img.shields.io/github/stars/modern-python/modern-di-starlette)](https://github.com/modern-python/modern-di-starlette/stargazers) | [![Downloads](https://static.pepy.tech/badge/modern-di-starlette/month)](https://pepy.tech/projects/modern-di-starlette) |
| [`modern-di-taskiq`](https://github.com/modern-python/modern-di-taskiq) | modern-di integration for taskiq | [![Stars](https://img.shields.io/github/stars/modern-python/modern-di-taskiq)](https://github.com/modern-python/modern-di-taskiq/stargazers) | [![Downloads](https://static.pepy.tech/badge/modern-di-taskiq/month)](https://pepy.tech/projects/modern-di-taskiq) |
| [`modern-di-typer`](https://github.com/modern-python/modern-di-typer) | modern-di integration for Typer | [![Stars](https://img.shields.io/github/stars/modern-python/modern-di-typer)](https://github.com/modern-python/modern-di-typer/stargazers) | [![Downloads](https://static.pepy.tech/badge/modern-di-typer/month)](https://pepy.tech/projects/modern-di-typer) |
Expand Down
13 changes: 13 additions & 0 deletions tests/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,16 @@ def test_every_download_badge_is_pepy_and_names_its_repo() -> None:
)
assert len(rows) == len(badges)
assert [repo for repo, package in rows if repo != package] == []


def test_every_social_card_tagline_is_its_profile_description() -> None:
"""INVARIANT: a docs repo's social-card tagline is the description in its profile row.

The profile row already mirrors the GitHub description and the pyproject
`description`. The card tagline is a fourth copy that lives in Python, so a
description rewrite updates the other three and leaves the card telling link
previews something the repo no longer says.
"""
text = _PROFILE.read_text(encoding="utf-8")
descriptions = dict(re.findall(r"^\| \[`([^`]+)`\]\([^)]*\) \| ([^|]+?) \|", text, flags=re.M))
assert p.DOCS_REPOS == {repo: descriptions[repo] for repo in p.DOCS_REPOS}
Loading