-
Notifications
You must be signed in to change notification settings - Fork 2.3k
prototype / demo: use rye #3266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
962c8d6 to
4d40841
Compare
|
From my point, the tool is rather new, but it seems in good hands and goes into the right direction. @return42 @Bnyro @unixfox @mrpaulblack and everyone else, what are your opinions on a tool like rye? |
Looks promising .. Most python build, env and package tools are based on the python itself installed on a system ... since different python versions are installed on all systems this usually does not work well (e.g. pyenv). I still have to take a closer look at Rye, but at first glance it does not seem to be programmed in python itself / does not have the described problems .. I found all previous solutions I have seen to complicated or too fragile, which is why I have always oriented myself to my shell scripts ... "bash" .. somewhat archaic but it always works. With rye we could have a real alternative in our hands ... we should definitely pursue this further .. And it's also from Armin Ronacher ... then it can only be good :) |
It uses prebuilt python version from https://github.com/indygreg/python-build-standalone
It is written in Rust and some Python: the first thing rye does is to download a Python version for its Python scripts. This is seamless, just a line of code.
The tool is new and hacky according Armin (I'm not sure he uses exactly this word, but that's the idea), but it gets good comments and reviews. The fact that astral endorse the project is another good point. |
|
This means that everybody willing to work on SearXNG needs to install Manually installing such a package before contributing is possible has the downside that some contributors might fail setting things up properly, and also cause inconvenience? (just my opinion) |
Yes
There is an issue about that: astral-sh/rye#452 Also, SearXNG already has many unusual setup:
I have not checked, may be it is possible to install it inside the |
That sounds great 👍 |
|
Installation without user interaction in a custom directory: 1/ Download the binary from https://github.com/astral-sh/rye/releases/tag/ 2/ Run $ RYE_HOME="$(pwd)/local" rye self install --toolchain /usr/bin/python3.10 --no-modify-path --yes--> As described in the log, the PATH must contains I will try to add that to the PR, so rye won't be a prior requirement. |
cf910f0 to
b3111f4
Compare
|
Done: rye is automatically downloaded and installed in the Actually now, you don't even need Python: rye is going to download the version defined in |
What does this PR do?
rye manages:
See https://rye-up.com/
With uv, which is not activated by default, rye creates the virtualenv very fast.
uv and rye are written by astral who makes ruff (actually rye is written by the creator of Flask, but the project has joined astral)
To enable uv, see https://rye-up.com/guide/config/#configtoml
~/.rye/config.toml.use-uv = truein thebehaviorsection.Why is this change important?
This PR is demo / prototype to show how we can remove a lot of boilerplate and create a standard pyproject.toml.
How to test this PR locally?
make test,make runas usualAuthor's checklist
This is a quick & dirty implementation, expect things to break.
npx is not installed, so
make test.pyrightdoes nothing.Also rye does not like symbolic links, so I removed them since there are required for the installation phase but not for development (perhaps that's was only for
rye init, I have not tried after).The dynamic creation of version file is not implemented, I guess build-system has to be setuptools instead of hatchling (or may be hatchling can do that).
Related issues
Related to a PR forgotten at the bottom of the ocean : #2121