diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5bf3c35c..4ca8937e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,14 +25,20 @@ jobs: with: python-version: ${{ matrix.python-version }} + docs: + runs-on: ubuntu-latest + needs: [test] + steps: + - uses: ocadotechnology/codeforlife-workspace/.github/actions/python/docs@actions # TODO: use @main + release: concurrency: release runs-on: ubuntu-latest - needs: [test] + needs: [docs] if: github.ref_name == 'main' steps: - name: 🛫 Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} fetch-depth: 0 diff --git a/.gitignore b/.gitignore index ff08be71..f530e735 100644 --- a/.gitignore +++ b/.gitignore @@ -40,10 +40,10 @@ pip-log.txt pip-delete-this-directory.txt # Any graphs generated in the docs -docs/*.png +# docs/*.png # Any dot files generated by pydot -*.dot +# *.dot # Unit test / coverage reports htmlcov/ diff --git a/Pipfile b/Pipfile index 7f76e7fb..958460c4 100644 --- a/Pipfile +++ b/Pipfile @@ -27,6 +27,7 @@ django-stubs = {version = "==4.2.6", extras = ["compatible-mypy"]} djangorestframework-stubs = {version = "==3.14.4", extras = ["compatible-mypy"]} pylint = "==3.0.2" pylint-django = "==2.5.5" +pygraphviz = "==1.11" [requires] python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock index 40e060d1..d5ff5827 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "860196ab795a6de76b8a385ea76f4b38f982839b4aa23ea3b16248af01b555a7" + "sha256": "ce73cbc4b15764c1ed7c7500fa602482a32a541d7619ad6a89cae58d1493f7b2" }, "pipfile-spec": 6, "requires": { @@ -555,11 +555,11 @@ }, "isort": { "hashes": [ - "sha256:56a51732c25f94ca96f6721be206dd96a95f42950502eb26c1015d333bc6edb7", - "sha256:aaed790b463e8703fb1eddb831dfa8e8616bacde2c083bd557ef73c8189b7263" + "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109", + "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6" ], "markers": "python_full_version >= '3.8.0'", - "version": "==5.13.1" + "version": "==5.13.2" }, "mccabe": { "hashes": [ @@ -650,6 +650,13 @@ "index": "pypi", "version": "==1.4.2" }, + "pygraphviz": { + "hashes": [ + "sha256:a97eb5ced266f45053ebb1f2c6c6d29091690503e3a5c14be7f908b37b06f2d4" + ], + "index": "pypi", + "version": "==1.11" + }, "pylint": { "hashes": [ "sha256:0d4c286ef6d2f66c8bfb527a7f8a629009e42c99707dec821a03e1b51a4c1496", diff --git a/codeforlife/settings/third_party.py b/codeforlife/settings/third_party.py index 11afa12e..49914e45 100644 --- a/codeforlife/settings/third_party.py +++ b/codeforlife/settings/third_party.py @@ -23,3 +23,16 @@ ], "DEFAULT_PAGINATION_CLASS": "codeforlife.pagination.LimitOffsetPagination", } + +# Django Extensions - Graph Models +# https://django-extensions.readthedocs.io/en/latest/graph_models.html?highlight=graph_models#default-settings + +GRAPH_MODELS = { + "all_applications": True, + "group_models": True, + "pygraphviz": True, + "output": "docs/entity_relationship_diagram.png", + "arrow_shape": "normal", + "color_code_deletions": True, + "rankdir": "BT", +} diff --git a/manage.py b/manage.py index b374b966..879546bb 100644 --- a/manage.py +++ b/manage.py @@ -13,6 +13,7 @@ "django.contrib.staticfiles", "django.contrib.sites", "codeforlife.user", + "django_extensions", ] MIDDLEWARE = [