The pytesseract package needs to have the `tesseract` executable available at runtime to work.
By default, the Python package looks for the `tesseract` executable in the PATH. This doesn't work here, so we need to override the `tesseract_cmd` with the path to the `tesseract` executable we pulled in from Nix. I did this with a patch [based on how pytesseract is set up in Nixpkgs][1].
The patching code feels a bit fiddly. I don't know the idiomatic way to do this sort of thing.
I included a test that will fail if pytesseract cannot find the `tesseract` executable. The test passed for me with both `preferWheels = true` and `preferWheels = false`, but I only included one in the test suite here, not sure if it makes sense to have both—the actual patching code had to be a bit different depending on whether the source was a wheel or not.
[1]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/pytesseract/tesseract-binary.patch
Improves consistency. Most entries are already sorted this way.
Improves readability, since entries are now sorted in increasing
chronological order.
Helps with #1320.
Note that manually overriding the `buildInputs` actually results in:
```sh
last 10 log lines:
> Executing pythonRemoveTestsDir
> Finished executing pythonRemoveTestsDir
> pythonCatchConflictsPhase
> /nix/store/q2zpnf017gccs9w9mb0ikdqhkf0k5v82-catch_conflicts.py:1: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
> import pkg_resources
> Found duplicated packages in closure for dependency 'hatchling':
> hatchling 1.18.0 (/nix/store/zjkajhjjz7wis9yvm3gwvphifx3hiav2-python3.10-hatchling-1.18.0/lib/python3.10/site-packages)
> hatchling 1.18.0 (/nix/store/2jy9c8hbk8v0rk45zv8680srs1jky977-python3.10-hatchling-1.18.0/lib/python3.10/site-packages)
>
> Package duplicates found in closure, see above. Usually this happens if two packages depend on different version of the same dependency.
```
pydantic v2 spun up BaseSettings into a separate package called pydantic-settings.
Also removing pydantic-dydb and minimal-dydb as they are no longer on PyPI.