Last active
January 6, 2023 11:55
-
-
Save Winand/8cd112e08f16647b5311729367547506 to your computer and use it in GitHub Desktop.
Nox in docker example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
def Main(): | |
x = os.getpid() | |
print(f"{x=}") | |
if __name__ == '__main__': | |
Main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -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