Compute the version in the same way as setup.py does