Sopeira is a Spanish municipality in the province of Huesca, in the autonomous community of Aragón, Spain