Python advice requested:

I need to include a small test program, written in Python, in a repository containing other software not in Python. The program will have multiple source files and use dependencies from PyPI, but does not need to be installed anywhere. The expected usage is to just run it directly from the directory where it lives.

Is there a suitable tool to use to run it which will create a temporary virtual environment, install the dependencies, run the program, and then clean that stuff up?

#Python

@kevin uv can run scripts with in-line dependencies:
https://docs.astral.sh/uv/guides/scripts/
Running scripts | uv

A guide to using uv to run Python scripts, including support for inline dependency metadata, reproducible scripts, and more.