Guys, we need to have a chat about testing. I've repeatedly deferred
writing this a few times over the past 6 months on the hopes of
writing it later when I'm a bit less emotionally involved.
The tl;dr is simply that setuptools (and preferably the rest of the
pypa stack) really needs some black box tests covering _minimum viable
functionality_ for recent/supported versions of Python, and those
version combinations need to be published somewhere. I'm 100% on board
for doing the trivial work required to make this happen.
As part of maintaining py-lmdb approximately once per month, I have a
need to observe the output of TravisCI, which executes setuptools on
my behalf against all widely deployed versions of Python starting from
2.5 (i.e. all except 3.0).
py-lmdb isn't interesting in itself, only that it attempts to remain
compatible with all versions of Python that might, somewhere behind
closed doors, be in use in some commercial environment. The package
does almost nothing fancy - it could be seen as approaching the
smallest possible test for a viable working packaging environment.
Despite sampling the present state of the packaging universe at most
once per month, almost reliably each month, I find 90% of my time is
consumed not in maintaining my package, but in shepherding the build
back into a working state, which more often than not has broken since
the last time I made any commits.
This has been going on for at least 4 months, and each time it
happens, I vow never to waste time on the problem again, and proceed
to incrementally remove yet another aspect of the
virtualenv/pip/setuptools/tox stack.
All the above tools have fundamental problems operating under at least
one recent version of Python - for example, setuptools was broken on
Python3.1 due to SSL assumptions, the Tox "vendored" version of
virtualenv recently started breaking against an older Python, and so
on.
As of today there is no single configuration of the above tools that
function reliably under all interesting versions of Python - and ISTM
often for unjustifiably trivial reasons (although I'm sure those with
experience of actually maintaining the stack may entirely disagree ;).
Today my build process no longer depends on any of virtualenv, pip, or
tox, yet still this month I've again found it broken, this time - most
damningly - due to a NameError in ez_setup.py master - a NameError
that makes it clear to me that code being committed to a critical
Python repository is being neither peer reviewed thoroughly nor tested
to any level of sensibility.
We should discuss how this stuff is tested - it's far too important to
the community to fall to the whim of random unreviewed commits. I
appreciate that various pypa tooling tests suck, and getting
comprehensive tests takes time, however writing an *ultra basic* smoke
test is very little work - in the ideal case it's a 30 line shell
script run for each "supported" configuration of the tooling.
I am more than willing to dedicate time to producing a CI
configuration and associated script that executes such a test, since
the effort in doing so is less than the time I appear to predictably
spend monthly trying to fix up the effects of their absence. But first
obviously there needs to be some consensus on this.
Glancing at setuptools .travis.yml hg log, I see that of the few tests
that exist for setuptools, none are run on Python2.5 any more. While
TravisCI is a cute and fashionable convenience, their decision to
remove Python2.5 from the base image *should not be dictating policy
for the wider Python community*, especially for such a widely deployed
Python release.
The proposed smoke test would simply install some popular Python
package that ideally includes at least one C extension. The test
succeeds if the package is installed and can be imported using the
version of Python under test. Preferably it would execute on each
commit, but even just running it before a release would suffice.
If you look at
https://github.com/dw/py-lmdb/blob/master/.runtests-travisci.sh
you can see an example of how to get TravisCI base image into a state
where all recent versions of Python exist. This script is a direct
result of having spent a full weekend, abandoning all hope of getting
Tox/virtualenv/pip working in unison for all interesting Python
versions.
Initially, it would be great to get setuptools .travis.yml updated to
use something similar to the above script, and, say, installing the
lxml package (which has a nicely complex
setup.py/compiler
dependency).
Thoughts?
David