Let $A$ be a commutative ring with unit, $X=\operatorname{Spec}A$, $\mathcal{B}$ the base of open subsets on $X$ made up of the principal open subsets. Then Liu's book "The Algebraic Geometry and Arithmetic Curves" gives a proof of the following (page 42):
$\mathcal{O}_X$ is a $\mathcal{B}$-sheaf of rings. It therefore induces a sheaf of rings $\mathcal{O}_X$ on $\operatorname{Spec}A$, and we have $\mathcal{O}_X(X)=A$.
In the proof Liu verifies the uniqueness and glueing local sections for the open set $U=X$.
Is this special case needed in proving the general case where $U$ is an arbitrary principal open set or do we need completely different proof in the general case?