Package: rye
IntroRye is a python task automation tool. It isoneofalonglistof other projects. The question at this point should be, why not
just use one of thos other tools?
The answer is that I had a workflow in mind, but couldn’t quite get any
of the other tools to do it.Read from a simple config fileMaintain a set of virtualenvs for each environmentUpdate those environments when my pyproject.toml or poetry.lock files changed.Run all my tasks in parallelLet tasks share environments where that makes sense (lint and typing?)Work with poetryAllow installing dependencies and the package separately (for Dockerfile caching)I was trying to set this up without thinking it through a ton, and kept fighting with
tox’s built in defaults. No way to install packages without the source code. Using
poetry involved some truly ugly hacks. No auto-update of environments, and hard to share
environments between tasks. I did like that it depended on a config file with a lot of
built in behaviors that you could inherit from!I looked at stuff like Nox and Invoke- Nox required more programming then tox and still
had a bunch of defaults I’d have to figure out how to override. Invoke would have just
been working from scratch.What I really wanted was a makefile- list tasks, specify dependencies for those tasks,
and rebuild them when the dependencies change. The actual commands to run should
be completely configurable. So Rye was born. It uses pyproject.toml as configuration.
It will automatically keep your virtual environments in sync with your config files-
no matter the tool you’re using. It has a good set of default behaviors you can pull in.
Best of all, every step of the process is completely configurable- if you want!# pyproject.toml[tool.rye]default_tasks=["test","lint","format","typing"][tool.rye."task.pytest"]target_environments=["poetry.py37","poetry.py36"][tool.rye."poetry.py36"."task.pytest"]commands=[["pytest","tests","--no-cov"]][tool.rye."task.lint"]target_environments=["poetry.py37"]commands=[["pylint","src/rye","tests"]][tool.rye."task.format"]target_environments=["poetry.py37"]commands=[["black",".","--check"],["isort","-rc","-tc","--check-only","src","tests"],][tool.rye."task.typing"]target_environments=["poetry.py37"]commands=[["mypy","src/rye","--ignore-missing-imports"],]OR, YAMLdefault_tasks:-test-lint-format-typingtask.pytest:target_environments:-poetry.py37-poetry.py36poetry.py36:task.pytest:commands:-["pytest","tests","--no-cov"]task.lint:target_environments:-poetry.py37commands:-["pylint","src/rye","tests"]task.format:target_environments:-poetry.py37commands:-["black",".","--check"]-["isort","-rc","-tc","--check-only","src","tests"]task.typing:target_environments:-poetry.py37commands:-["mypy","src/rye","--ignore-missing-imports"]$ryeRunningtasks-['poetry.py37','TASK poetry.py37#lint','TASK poetry.py37#format','TASK poetry.py37#typing']ENVpoetry.py37>PreparingEnvENVpoetry.py37>Alreadyusinginterpreter/home/pbecotte/venvs/rye/bin/python3.7ENVpoetry.py37>Usingbaseprefix'/usr'ENVpoetry.py37>Newpythonexecutablein/home/pbecotte/PycharmProjects/rye/.rye/py37/bin/python3.7ENVpoetry.py37>Alsocreatingexecutablein/home/pbecotte/PycharmProjects/rye/.rye/py37/bin/pythonENVpoetry.py37>Installingsetuptools,pip,wheel...Read the full documentation athttps://rye.readthedocs.io/en/latest/Or check out the source athttps://gitlab.com/pjbecotte/ryeInstallationYou can install Rye from pypi-pip install rye