From d9240e46239f3622c739043a5e6cbf605a6244d2 Mon Sep 17 00:00:00 2001 From: Maciej Urbanski Date: Fri, 5 Jul 2024 15:56:02 +0200 Subject: [PATCH] add django up function to cookiecutter noxfile --- noxfile.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 323c81b..9250514 100644 --- a/noxfile.py +++ b/noxfile.py @@ -189,7 +189,6 @@ def crufted_project(session, cruft_config): project_path = tmpdir_path / cruft_config["package_name"] if not project_path.exists(): session.log("Creating project in %s", tmpdir.name) - # project_path.mkdir(parents=True) with with_dirty_commit(session): session.run( "cruft", @@ -228,6 +227,15 @@ def rm_root_owned(session, dirpath): ) +@contextlib.contextmanager +def docker_up(session): + session.run("docker", "compose", "up", "-d") + try: + yield + finally: + session.run("docker", "compose", "down", "-v", "--remove-orphans") + + @nox.session(python=PYTHON_DEFAULT_VERSION, tags=["crufted_project"]) @nox.parametrize("cruft_config_name", CRUFT_TESTED_CONFIGS) def lint_crufted_project(session, cruft_config_name):