-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[enh] add pyproject.toml listing build requirements #4141
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
base: master
Are you sure you want to change the base?
Conversation
To run the setup.py pyyaml needs to already be installed. PEP 518 'Specifying Minimum Build System Requirements for Python Projects' introduced the pyproject.toml file to specify the required dependencies in a format that build tooling like pip can parse prior to executing the setup.py. This commit adds a pyproject.toml with the basic requirements of setuptools and pyyaml required to run the current setup.py.
I understand the intention, but I am unsure whether this is a good idea. SearXNG is not a Python package (!) that users can install in their Python installation / it will never be offered as a package on pypi. As a rolling release it will only ever be installed in developer mode ( We can only provide support for the installation methods described under in the chapter Installation I mark this PR as DRAFT. |
|
I understand that installation through pip with e.g., Furthermore, I have to add that even the step by step installation explicitly contains I would very much prefer an explicit warning or error when running the setup.py through pip aka installing searx through pip. |
Surely true. The short answer: SearXNG is not ready yet / or at least I'm not ready yet. In the long term, I would like to develop SearXNG so that it is no longer an application but a library that can also be installed via pypi. But we are still a long way from that. If we introduce a pyproject.toml, then this should also simplify the complexity of our environment; we are currently still using various shell scripts to build up a developer environment. So it is not enough to create a pyproject.toml, the entire developer environment must be migrated from the shell scripts to a development environment such as hatch. @dalf implemented a prototype based on rye Personally, however, I think we would be better off relying on hatch. For such decisions some experience is needed which we (I) still have to build up. Quite apart from the fact that the migration is also a big task ... (take in mind, it will also touch the installation methods we support today). However, we still have other major tasks, such as the typing of the engines and the result types, which are also a prerequisite for turning SearXNG into a library ..
This is currently our smallest problem for which we have a solution (shell script and I also want to avoid contributors starting to put something in pyproject.toml that we (also) need in the shell scripts ... and then we have duplicate implementations for the same task ... (this PR adds something that we already have in the shell scripts, when we need one requirement more in the developer environment we have to add it in two places from now on). I just ask for your understanding that we don't start things halfway without having a concept for the complete solution ... this approach of adding something “here and there” makes the project error-prone and the development more and more difficult. We have already built in too many “quick fixes” in the past ... the dismantling later is all the more painful ... we should better leave it, even if we can't satisfy everyone for the moment. |
What does this PR do?
This PR adds a pyproject.toml with the basic requirements of setuptools and pyyaml required to run the current setup.py.
Why is this change important?
To run the setup.py pyyaml needs to already be installed. PEP 518 'Specifying Minimum Build System Requirements for Python Projects' introduced the pyproject.toml file to specify the required dependencies in a format that build tooling like pip can parse prior to executing the setup.py.
How to test this PR locally?
Test e.g.,
pip install .in a clean environment. Prior to this PR pip would fail with a subprocess error ofModuleNotFoundError: No module named 'yaml'with this PR pip installs searxng nicely.