Skip to content

Commit

Permalink
Merge branch 'main' into add-jupyter-books-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pydanny authored Sep 28, 2023
2 parents bb396b6 + 7197b36 commit e05a08b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
TODO
# [v0.2.2](https://github.com/pydanny/dj-notebook/releases/tag/v0.2.2)

2023-09-26T15:24:15Z by
[@pydanny](https://github.com/pydanny)

## ## What's Changed
* Correct the release notes by @pydanny in https://github.com/pydanny/dj-notebook/pull/26


**Full Changelog**: https://github.com/pydanny/dj-notebook/compare/v0.2.1...v0.2.2
11 changes: 6 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
changelog: # Install gh cli and jq first
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/pydanny/dj_notebook/releases/latest > changelog.json
jq -r '.tag_name' changelog.json
jq -r '.body' changelog.json
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/pydanny/dj-notebook/releases/latest > changelog.json

python utils/update_changelog.py
rm changelog.json

lint:
black .
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "dj_notebook"
version = "0.2.1"
version = "0.2.2"
description = "A Jupyter notebook with access to objects from the Django ORM is a powerful tool to introspect data and run ad-hoc queries."
readme = "README.md"
authors = [
Expand Down
29 changes: 29 additions & 0 deletions utils/update_changelog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import json
import pathlib
import typing


def main() -> None:
changes: dict[str, typing.Any] = json.loads(
pathlib.Path("changelog.json").read_text()
)
previous_changelog: str = pathlib.Path("CHANGELOG.md").read_text()

new_changelog: str = f"""
# [{changes["tag_name"]}]({changes['html_url']})
{changes['created_at']} by
[@{changes['author']['login']}]({changes['author']['html_url']})
## {changes["body"]}
---
{previous_changelog}
"""

pathlib.Path("CHANGELOG.md").write_text(new_changelog)


if __name__ == "__main__":
main()

0 comments on commit e05a08b

Please sign in to comment.