Crates.io | rpy |
lib.rs | rpy |
version | 0.2.2 |
source | src |
created_at | 2022-12-06 22:43:05.531301 |
updated_at | 2023-10-11 20:34:57.268148 |
description | Run the appropriate python interpreter in the right way |
homepage | |
repository | https://github.com/aquanauts/rpy |
max_upload_size | |
id | 731458 |
size | 44,871 |
Do you deal with lots of virtual python environments? rpy
is for you!
Before rpy
:
~/dev/prj$ env PYTHONPATH=src/py path/to/my/interpreter src/py/my/script.py --my --args here
After:
~/dev/prj$ rpy src/py/my/script.py --my --args here
rpy
looks for a pyproject.toml
file relating to the script, and then looks for a tool.py
section of the form:
[tool.rpy]
# All paths are relative to the project root (which is wherever we found the pyproject.toml
interpreter = 'out/env/bin/python' # path relative to the project root
source_root = 'src/py' # Optional PYTHONPATH to set up (defaults to project root)
pre_run = 'make --quiet deps' # Optional command to run in the project root first