Skip to content

Commit

Permalink
Add VENV_DIR to dev session in cookbook, fix #588 (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickleDave committed Apr 4, 2022
1 parent 05b2096 commit d947833
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ Enter the ``dev`` nox session:
# so it's not run twice accidentally
nox.options.sessions = [...] # Sessions other than 'dev'
# this VENV_DIR constant specifies the name of the dir that the `dev`
# session will create, containing the virtualenv;
# the `resolve()` makes it portable
VENV_DIR = pathlib.Path('./.venv').resolve()
@nox.session
def dev(session: nox.Session) -> None:
"""
Expand All @@ -61,8 +66,7 @@ Enter the ``dev`` nox session:
"""
session.install("virtualenv")
# VENV_DIR here is a pathlib.Path location of the project virtualenv
# e.g. .venv
# the VENV_DIR constant is explained above
session.run("virtualenv", os.fsdecode(VENV_DIR), silent=True)
python = os.fsdecode(VENV_DIR.joinpath("bin/python"))
Expand Down

0 comments on commit d947833

Please sign in to comment.