Development environment instructions should describe requirement for postgresql libraries
Without the postgresql libraries, make devdata fails when installing requirements. Specifically, installation of psycopg2 fails with errors that include:
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
There are potentially a couple of solutions:
- Document that postgresql libraries are required for installation (postgresql-dev, libpq-dev, or whatever the distribution in question calls for.
- Depend on psycopg2-binary instead as the error message suggests. This might necessarily be as easy as it seems, since it's not just a direct specified dependency but I think may also be a transitive dependency.
- Upgrade to the psycopg package (the new name given to "psycopg3"), which does not appear to have this problem. That's probably the best idea in the long run since version 2 of psycopg is deprecated, but may involve other updates, too.
As a bonus for consideration of moving to psycopg3, it would obviate the need for psycogreen.
make devdata is currently intended only for use by Hypothesis staff, external contributors should skip that step. We should update the documentation to make this clear. What it does is to add some users and groups to the database which are useful for testing Hypothesis's commercial add-ons, like the LMS integration.
I agree that the fact that make devdata accesses a private git repo for some bootstrap data is something that should be documented. I think that's fairly longstanding but I couldn't find a specific issue for it-- maybe I'd just read about it in slack.
That doesn't change the fact that postgresql libraries are required for any development install-- in the absence of running make devdata, I think an external-to-hypothesis developer would still need to run something like make db to run db setup/migrations, and that would end up pulling in those dependencies.
Or even for people within hypothesis that need to follow through these instructions, it seems like postgresql libraries are still needed when running make devdata (but of course I cannot verify that).