We consider supersymmetric field theories on compact manifolds M and obtain constraints on the parameter dependence of their partition functions Z M . Our primary focus is the dependence of Z M on the geometry of M, as well as background gauge fields that couple to continuous flavor symmetries. For N = 1 theories with a U(1) R symmetry in four dimensions, M must be a complex manifold with a Hermitian metric. We find that Z M is independent of the metric and depends holomorphically on the complex structure moduli. Background gauge fields define holomorphic vector bundles over M and Z M is a holomorphic function of the corresponding bundle moduli. We also carry out a parallel analysis for three-dimensional N = 2 theories with a U(1) R symmetry, where the necessary geometric structure on M is a transversely holomorphic foliation (THF) with a transversely Hermitian metric. Again, we find that Z M is independent of the metric and depends holomorphically on the moduli of the THF. We discuss several applications, including manifolds diffeomorphic to S 3 ×S 1 or S 2 ×S 1 , which are related to supersymmetric indices, and manifolds diffeomorphic to S 3 (squashed spheres). In examples where Z M has been calculated explicitly, our results explain many of its observed properties.