Contextuality is the failure of 'local' probabilistic models to become global ones. In this paper, we introduce the notions of measurable fibre bundle, probability fibre bundle and sample fibre bundle which capture and make precise the former statement. The central notions of contextuality are discussed under this formalism, examples worked out, and some new aspects pointed out. This article is part of the theme issue 'Contextuality and probability in quantum mechanics and beyond'3772157CONSELHO NACIONAL DE DESENVOLVIMENTO CIENTÍFICO E TECNOLÓGICO - CNPQnão temThis work received support from the Brazilian agency CNPq, also from the Brazilian National Institute for Science and Technology on Quantum Information and finally from Purdue Winer M...