rpy

Crates.iorpy
lib.rsrpy
version0.2.2
sourcesrc
created_at2022-12-06 22:43:05.531301
updated_at2023-10-11 20:34:57.268148
descriptionRun the appropriate python interpreter in the right way
homepage
repositoryhttps://github.com/aquanauts/rpy
max_upload_size
id731458
size44,871
Matt Godbolt (mattgodbolt)

documentation

README

rpy

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

The magic

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
Commit count: 37

cargo fmt