File: noxfile_script_mode_exec.py

package info (click to toggle)
python-nox 2025.11.12-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,880 kB
  • sloc: python: 10,199; makefile: 204; sh: 6
file content (21 lines) | stat: -rwxr-xr-x 402 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python

# /// script
# dependencies = ["nox", "cowsay"]
# ///


import nox


@nox.session
def exec_example(session: nox.Session) -> None:
    # Importing inside the function so that if the test fails,
    # it shows a better failure than immediately failing to import
    import cowsay  # noqa: PLC0415

    print(cowsay.cow("another_world"))


if __name__ == "__main__":
    nox.main()