From 2ea883a2d422c0cf2830e827d4f79e72258f05a9 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 19 Mar 2024 16:03:19 -0400 Subject: [PATCH] feat: add a dev command to nox (#134) --- noxfile.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/noxfile.py b/noxfile.py index 050d60a..23f0526 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,5 +1,7 @@ from __future__ import annotations +import sys + import nox nox.options.sessions = ["lint", "tests"] @@ -21,3 +23,19 @@ def tests(session: nox.Session) -> None: """ session.install(".[test]") session.run("pytest", *session.posargs) + + +@nox.session(venv_backend="none") +def dev(session: nox.Session) -> None: + """ + Prepare a .venv folder. + """ + + session.run(sys.executable, "-m", "venv", ".venv") + session.run( + ".venv/bin/pip", + "install", + "-e.", + "-Ccmake.define.CMAKE_EXPORT_COMPILE_COMMANDS=1", + "-Cbuild-dir=build", + )