A PEP 772 implementation
Project description
Idae
A PEP 723 implementation
Usage
Run like normal Python except that the first argument must be a path to the script.
idae example.py
The dependency specification within the Python script must be like the following (example from PEP 723):
# /// pyproject
# [run]
# requires-python = ">=3.11"
# dependencies = [
# "requests<3",
# "rich",
# ]
# ///
import requests
from rich.pretty import pprint
resp = requests.get("https://peps.python.org/api/peps.json")
data = resp.json()
pprint([(k, v["title"]) for k, v in data.items()][:10])
Caveats
- Does not support Windows
- Does not respect
requires-python
- Fails silently if the dependencies could not be found
- Crappy interface
How it works
- Detect script file
- Use venv to create a temporary virtual environment named
idae-venv
using the Python executable used to runidae
- Find PEP 723 requirements
- Install them into the venv
- Run the script within the venv
- Delete the venv
Installation
You can get this project via pip
$ pip install idae
But we highly recommend you install this project using pipx
$ pipx install idae
Why the name
The scientific name for Pythons is "Pythonidae". I just removed the "Python" and we get "idae".
License
Copyright © 2021, Bryan Hu
This project is licensed under the GNU GPL v3+.
In short, this means you can do anything with it (distribute, modify, sell) but if you were to publish your changes, you must make the source code and build instructions readily available.
If you are a company using this project and want an exception, email me at thatxliner@gmail.com and we can discuss.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.