diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0013dfa07..a4862d727 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -76,7 +76,9 @@ jobs: python-version: 3.11 cache: 'poetry' - name: Install Python dependencies - run: poetry install + run: | + sudo apt-get install --yes --quiet --no-install-recommends graphviz libgraphviz-dev + poetry install - name: System checks run: poetry run ./manage.py check - name: Check for missing migrations diff --git a/Dockerfile b/Dockerfile index 21bcdae1a..dc3463fa1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -58,6 +58,12 @@ ENV PATH=$VIRTUAL_ENV/bin:$PATH \ ARG BUILD_ENV ENV BUILD_ENV=${BUILD_ENV} +# install graphviz only in dev environment +RUN if [ "$BUILD_ENV" = "dev" ] ; then \ + apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \ + graphviz libgraphviz-dev \ + && apt-get autoremove && rm -rf /var/lib/apt/lists/* ; \ + fi # Port exposed by this container. Should default to the port used by your WSGI # server (Gunicorn). This is read by Dokku only. Heroku will ignore this. diff --git a/poetry.lock b/poetry.lock index 0482c734b..ac0d22306 100644 --- a/poetry.lock +++ b/poetry.lock @@ -590,13 +590,13 @@ sqlparse = ">=0.2" [[package]] name = "django-extensions" -version = "3.2.1" +version = "3.2.3" description = "Extensions for Django" optional = false python-versions = ">=3.6" files = [ - {file = "django-extensions-3.2.1.tar.gz", hash = "sha256:2a4f4d757be2563cd1ff7cfdf2e57468f5f931cc88b23cf82ca75717aae504a4"}, - {file = "django_extensions-3.2.1-py3-none-any.whl", hash = "sha256:421464be390289513f86cb5e18eb43e5dc1de8b4c27ba9faa3b91261b0d67e09"}, + {file = "django-extensions-3.2.3.tar.gz", hash = "sha256:44d27919d04e23b3f40231c4ab7af4e61ce832ef46d610cc650d53e68328410a"}, + {file = "django_extensions-3.2.3-py3-none-any.whl", hash = "sha256:9600b7562f79a92cbf1fde6403c04fee314608fefbb595502e34383ae8203401"}, ] [package.dependencies] @@ -1697,6 +1697,20 @@ files = [ {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, ] +[[package]] +name = "pydot" +version = "1.4.2" +description = "Python interface to Graphviz's Dot" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "pydot-1.4.2-py2.py3-none-any.whl", hash = "sha256:66c98190c65b8d2e2382a441b4c0edfdb4f4c025ef9cb9874de478fb0793a451"}, + {file = "pydot-1.4.2.tar.gz", hash = "sha256:248081a39bcb56784deb018977e428605c1c758f10897a339fce1dd728ff007d"}, +] + +[package.dependencies] +pyparsing = ">=2.1.4" + [[package]] name = "pyflakes" version = "2.4.0" @@ -1722,6 +1736,16 @@ files = [ [package.extras] plugins = ["importlib-metadata"] +[[package]] +name = "pygraphviz" +version = "1.11" +description = "Python interface to Graphviz" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pygraphviz-1.11.zip", hash = "sha256:a97eb5ced266f45053ebb1f2c6c6d29091690503e3a5c14be7f908b37b06f2d4"}, +] + [[package]] name = "pymdown-extensions" version = "10.0.1" @@ -1781,6 +1805,20 @@ cryptography = ">=38.0.0,<40" docs = ["sphinx (!=5.2.0,!=5.2.0.post0)", "sphinx-rtd-theme"] test = ["flaky", "pretend", "pytest (>=3.0.1)"] +[[package]] +name = "pyparsing" +version = "3.1.1" +description = "pyparsing module - Classes and methods to define and execute parsing grammars" +optional = false +python-versions = ">=3.6.8" +files = [ + {file = "pyparsing-3.1.1-py3-none-any.whl", hash = "sha256:32c7c0b711493c72ff18a981d24f28aaf9c1fb7ed5e9667c9e84e3db623bdbfb"}, + {file = "pyparsing-3.1.1.tar.gz", hash = "sha256:ede28a1a32462f5a9705e07aea48001a08f7cf81a021585011deba701581a0db"}, +] + +[package.extras] +diagrams = ["jinja2", "railroad-diagrams"] + [[package]] name = "python-dateutil" version = "2.8.2" @@ -2794,4 +2832,4 @@ gunicorn = ["gunicorn"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "89f7743afdfbdc30b089cfb2155aa08841bbb073ad5b46ed9a70f868e871ad15" +content-hash = "ccd8883420d4c7c03763fa195b4234b2e2fc1acc24fb9a9445dac0ea9618476f" diff --git a/pyproject.toml b/pyproject.toml index 6d3ca9af7..960121451 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ python = "^3.11" Django = "~4.2" wagtail = "~5.2" psycopg2 = "^2.9.3" -gunicorn = {version = "^20.1.0", optional = true} +gunicorn = { version = "^20.1.0", optional = true } django-pattern-library = "^1.1.0" whitenoise = "^6.1.0" dj-database-url = "^0.5.0" @@ -37,11 +37,14 @@ gunicorn = ["gunicorn"] [tool.poetry.dev-dependencies] Werkzeug = "^2.1.2" django-debug-toolbar = "^4.1.0" -django-extensions = "^3.2.1" +django-extensions = "^3.2.3" fabric = "~2.5" stellar = "^0.4.5" pudb = "^2020.1" honcho = "^1.1.0" +pygraphviz = "^1.11" +pyparsing = "^3.1.1" +pydot = "^1.4.2" # Linters etc. black = "^22.3.0" diff --git a/tbx/settings/dev.py b/tbx/settings/dev.py index 47690de84..90f079fb7 100644 --- a/tbx/settings/dev.py +++ b/tbx/settings/dev.py @@ -47,6 +47,8 @@ "SHOW_COLLAPSED": True, } +INSTALLED_APPS += ["django_extensions"] # noqa + try: from .local import * # noqa except ImportError: