Skip to content

Instantly share code, notes, and snippets.

@Winand
Last active January 6, 2023 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Winand/8cd112e08f16647b5311729367547506 to your computer and use it in GitHub Desktop.
Save Winand/8cd112e08f16647b5311729367547506 to your computer and use it in GitHub Desktop.
Nox in docker example
import os
def Main():
x = os.getpid()
print(f"{x=}")
if __name__ == '__main__':
Main()
import nox
# https://nox.thea.codes/en/stable/usage.html#re-using-virtualenvs
# same as -r option
# nox.options.reuse_existing_virtualenvs = True
@nox.session(python=["3.8", "3.9"])
def lint(session):
session.install("flake8")
session.run("flake8", "example.py")
# -r reuse environment, -R reuse environment and installed packages
docker run --rm -it -v ${PWD}:/src thekevjames/nox:latest nox -r -f src/noxfile.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment