distutils is not recommended for use and unnecessary for modern Python
environments. Use only setuptools instead. From
https://docs.python.org/3/library/distutils.html:
> Most Python users will not want to use this module directly, but
> instead use the cross-version tools maintained by the Python Packaging
> Authority. In particular, setuptools is an enhanced alternative to
> distutils ...
>
> The recommended pip installer runs all setup.py scripts with
> setuptools, even if the script itself only imports distutils. Refer to
> the Python Packaging User Guide for more information.
The FreeBSD-related condition which enables custom round() implementation is incorrect: one must include <sys/param.h> to get __FreeBSD_version value, and since it's not included here, the check succeeds while it shouldn't. Before it worked somehow, but since python 3.7 it results in conflicting declarations of round(). The condition is also no longer needed since FreeBSD 5.3 is unsupported for 12 years.
The errcodes.txt file contains all the errors for the currently
maintained server versions. There is only one error code missing,
probably unused, but adding it back anyway to keep the errcode module
unchanged.
Added tests to check bad types, which discovered the above problem: on
type error we would have decref'd on exit something that was only
borrowed (because we wouldn't have performed matching increfs).
Fixed several shortcomings highlighted in #576 and not fixed as
requested.
Also fixed broken behaviour of ignoring the algorithm if the connection
is missing.
Now tests all supported Python environments as well. Allows testing the
full matrix of Python version with a single command.
Include the command make in the whitelist_externals configuration to
avoid the runtime warning:
WARNING:test command found but not installed in testenv
cmd: /usr/bin/make
env: .../psycopg2/.tox/flake8
Maybe you forgot to specify a dependency? See also the whitelist_externals envconfig setting.