Supersymmetric partition functions on Riemann surfaces