Skip to content

Commit

Permalink
ci: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lyz-code committed Mar 12, 2024
1 parent f5f71ad commit da3c6de
Show file tree
Hide file tree
Showing 6 changed files with 533 additions and 854 deletions.
1,279 changes: 461 additions & 818 deletions pdm.lock

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/mkdocs_newsletter/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@

def version_info() -> str:
"""Display the version of the program, python and the platform."""
return dedent(f"""\
return dedent(
f"""\
------------------------------------------------------------------
mkdocs_newsletter: {__version__}
Python: {sys.version.split(" ", maxsplit=1)[0]}
Platform: {platform.platform()}
------------------------------------------------------------------""")
------------------------------------------------------------------"""
)
12 changes: 8 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def full_repo_(repo: Repo) -> Repo:
commit_date = datetime.datetime(2021, 2, 5, 12, tzinfo=tz.tzlocal())
index.add(["docs/devops/helm/helm.md", "docs/devops/devops.md"])
index.commit(
textwrap.dedent("""\
textwrap.dedent(
"""\
feat(helm): introduce Helm the Kubernetes package manager
[Helm](https://helm.sh/) is the package manager for Kubernetes. Through
Expand All @@ -94,7 +95,8 @@ def full_repo_(repo: Repo) -> Repo:
One of the most important goals of the DevOps initiative is to break the
silos between the developers and the sysadmins, that lead to ill feelings
and unproductivity."""),
and unproductivity."""
),
author=author,
committer=committer,
author_date=commit_date,
Expand Down Expand Up @@ -143,10 +145,12 @@ def full_repo_(repo: Repo) -> Repo:
commit_date = datetime.datetime(2021, 3, 2, 12, tzinfo=tz.tzlocal())
index.add(["docs/coding/tdd.md", "docs/coding/python/gitpython.md"])
index.commit(
textwrap.dedent("""\
textwrap.dedent(
"""\
feat(tdd): define test driven development
feat(gitpython): present the python library"""),
feat(gitpython): present the python library"""
),
author=author,
committer=committer,
author_date=commit_date,
Expand Down
24 changes: 16 additions & 8 deletions tests/unit/services/test_last_newsletters.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,12 @@ def test_create_newsletter_creates_daily_article(repo: Repo) -> None:
category_order=0,
file_="index.md",
)
file_content = dedent("""\
file_content = dedent(
"""\
# [Introduction](index.md)
* New: Create the introduction page""")
* New: Create the introduction page"""
)
changes_to_publish = DigitalGardenChanges(daily=[change])

result = create_newsletters(changes_to_publish, repo)
Expand Down Expand Up @@ -552,10 +554,12 @@ def test_create_newsletter_creates_weekly_articles(repo: Repo) -> None:
category_order=0,
file_="index.md",
)
file_content = dedent("""\
file_content = dedent(
"""\
# [Introduction](index.md)
* New: Create the introduction page""")
* New: Create the introduction page"""
)
changes_to_publish = DigitalGardenChanges(weekly=[change])

result = create_newsletters(changes_to_publish, repo)
Expand Down Expand Up @@ -584,10 +588,12 @@ def test_create_newsletter_creates_monthly_articles(repo: Repo) -> None:
category_order=0,
file_="index.md",
)
file_content = dedent("""\
file_content = dedent(
"""\
# [Introduction](index.md)
* New: Create the introduction page""")
* New: Create the introduction page"""
)
changes_to_publish = DigitalGardenChanges(monthly=[change])

result = create_newsletters(changes_to_publish, repo)
Expand Down Expand Up @@ -616,10 +622,12 @@ def test_create_newsletter_creates_yearly_articles(repo: Repo) -> None:
category_order=0,
file_="index.md",
)
file_content = dedent("""\
file_content = dedent(
"""\
# [Introduction](index.md)
* New: Create the introduction page""")
* New: Create the introduction page"""
)
changes_to_publish = DigitalGardenChanges(yearly=[change])

result = create_newsletters(changes_to_publish, repo)
Expand Down
18 changes: 12 additions & 6 deletions tests/unit/services/test_semantic_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def test_changes_extracts_commits_with_multiple_changes(repo: Repo) -> None:
commit_date = datetime.datetime(2021, 2, 5, tzinfo=tz.tzlocal())
repo.index.add(["docs/devops/helm/helm.md", "docs/devops/devops.md"])
repo.index.commit(
textwrap.dedent("""\
textwrap.dedent(
"""\
feat(helm): introduce Helm the Kubernetes package manager
[Helm](https://helm.sh/) is the package manager for Kubernetes.
Expand All @@ -99,7 +100,8 @@ def test_changes_extracts_commits_with_multiple_changes(repo: Repo) -> None:
One of the most important goals of the DevOps initiative is to break
the silos between the developers and the sysadmins, that lead to ill
feelings and unproductivity."""),
feelings and unproductivity."""
),
author=author,
committer=committer,
author_date=commit_date,
Expand All @@ -109,25 +111,29 @@ def test_changes_extracts_commits_with_multiple_changes(repo: Repo) -> None:
Change(
date=commit_date,
summary="Introduce Helm the Kubernetes package manager.",
message=dedent("""\
message=dedent(
"""\
[Helm](https://helm.sh/) is the package manager for Kubernetes.
Through charts it helps you define, install and upgrade even the most
complex Kubernetes applications."""),
complex Kubernetes applications."""
),
type_="feature",
scope="helm",
),
Change(
date=commit_date,
summary="Define DevOps.",
message=dedent("""\
message=dedent(
"""\
[DevOps](https://en.wikipedia.org/wiki/DevOps) is a set of practices
that combines software development (Dev) and information-technology
operations (Ops) which aims to shorten the systems development life
cycle and provide continuous delivery with high software quality.
One of the most important goals of the DevOps initiative is to break
the silos between the developers and the sysadmins, that lead to ill
feelings and unproductivity."""),
feelings and unproductivity."""
),
type_="feature",
scope="devops",
),
Expand Down
48 changes: 32 additions & 16 deletions tests/unit/test_newsletter_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ def test_newsletter_prints_level_1_change() -> None:

result = create_newsletter(changes)

assert result == dedent("""\
assert result == dedent(
"""\
# [Introduction](index.md)
* New: Add introduction""")
* New: Add introduction"""
)


def test_newsletter_prints_level_2_change() -> None:
Expand All @@ -57,12 +59,14 @@ def test_newsletter_prints_level_2_change() -> None:

result = create_newsletter(changes)

assert result == dedent("""\
assert result == dedent(
"""\
# Botany
## [Trees](trees.md)
* New: Add trees""")
* New: Add trees"""
)


def test_newsletter_prints_level_3_change() -> None:
Expand All @@ -89,14 +93,16 @@ def test_newsletter_prints_level_3_change() -> None:

result = create_newsletter(changes)

assert result == dedent("""\
assert result == dedent(
"""\
# DevOps
## Infrastructure as Code
### [Helm](helm.md)
* New: Add helm""")
* New: Add helm"""
)


def test_template_prints_changes_in_chronological_order() -> None:
Expand Down Expand Up @@ -127,11 +133,13 @@ def test_template_prints_changes_in_chronological_order() -> None:

result = create_newsletter(changes)

assert result == dedent("""\
assert result == dedent(
"""\
# [Introduction](index.md)
* New: Add introduction
* Improvement: Add new content""")
* Improvement: Add new content"""
)


def test_template_prints_changes_with_subsection_link() -> None:
Expand All @@ -154,10 +162,12 @@ def test_template_prints_changes_with_subsection_link() -> None:

result = create_newsletter(changes)

assert result == dedent("""\
assert result == dedent(
"""\
# [Introduction](index.md)
* Improvement: [Add new content](index.md#article-subsection)""")
* Improvement: [Add new content](index.md#article-subsection)"""
)


def test_template_prints_changes_with_message() -> None:
Expand Down Expand Up @@ -190,7 +200,8 @@ def test_template_prints_changes_with_message() -> None:

result = create_newsletter(changes)

assert result == dedent("""\
assert result == dedent(
"""\
# [Introduction](index.md)
* Improvement: Add new content
Expand All @@ -199,7 +210,8 @@ def test_template_prints_changes_with_message() -> None:
* Improvement: Add more content
Another short change description.""")
Another short change description."""
)


def test_template_prints_changes_with_long_message() -> None:
Expand Down Expand Up @@ -269,14 +281,16 @@ def test_template_sorts_changes_without_subsection() -> None:

result = create_newsletter(changes)

assert result == dedent("""\
assert result == dedent(
"""\
# [DevOps](devops.md)
* New: Create the devops introduction page.
## [Helm](helm.md)
* New: Create the helm introduction page.""")
* New: Create the helm introduction page."""
)


def test_template_group_changes_by_category() -> None:
Expand Down Expand Up @@ -320,7 +334,8 @@ def test_template_group_changes_by_category() -> None:

result = create_newsletter(changes)

assert result == dedent("""\
assert result == dedent(
"""\
# [DevOps](devops.md)
* New: Create the devops introduction page.
Expand All @@ -330,4 +345,5 @@ def test_template_group_changes_by_category() -> None:
## [Trees](trees.md)
* New: Create the trees introduction page.""")
* New: Create the trees introduction page."""
)

0 comments on commit da3c6de

Please sign in to comment.