Almost sure invariance principles for partial sums of weakly dependent random variables