A bunch of third-party Python package manager clients, most famously uv, support this now. They all use the same front-matter format (PEP 723). Unfortunately, pip (the first-party package manager client that's usually distributed with Python) doesn't support it yet: https://github.com/pypa/pip/issues/12891
Interesting... I'm not really involved in much/any Python development, but cool to know there are options out there. I've mostly just run existing projects as needed.