We improve on the best available bounds for the square-free sieve and provide a general framework for its applicability. The failure of the local-to-global principle allows us to obtain results better than those reached by a classical sieve-based approach. Techniques involving sphere-packing yield upper bounds on the number of integer and rational points on curves of positive genus.Comment: 51 pages; typos fixe