Skip to content

Commit fdce998

Browse files
committed
Use venv to ensure pip is updated
Use the venv `--update-deps` flag to ensure pip is updated when a new venv is created.
1 parent 6a52cff commit fdce998

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

noxfile.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,12 @@ def install(session: nox.Session) -> None:
107107
activate_command = f"source {venv_path}/activate"
108108

109109
if not os.path.exists(VENV_PATH):
110-
session.run(py_command, "-m", "venv", VENV_PATH)
111-
session.run(f"{venv_path}/python", "-m", "pip", "install", "--upgrade", "pip")
110+
session.run(py_command, "-m", "venv", VENV_PATH, "--upgrade-deps")
112111

113112
session.run(f"{venv_path}/python", "-m", "pip", "install", "-e", ".[dev,test]")
114113
session.run(f"{venv_path}/pre-commit", "install")
115114

116-
if not os.environ.get("VIRTUAL_ENV"):
115+
if not venv_path:
117116
session.log(f"\n\nRun '{activate_command}' to enter the virtual environment.\n")
118117

119118

0 commit comments

Comments
 (0)