Why when deriving the Clapeyron equation can you assume that dH = dq, as surely the pressure is not constant?
At any given temperature, the change from a liquid to a vapor occurs at constant pressure.  What we are trying to find with the Clapeyron equation is how this constant pressure changes as the given temperature changes.

At equilibrium at a given temperature and constant pressure, we have $$G_{vapor}=G_{liquid}$$ and $$S_{vapor}-S_{liquid}=\frac{(H_{vapor}-H_{liquid})}{T}$$

Now, if we want to find out how temperature and pressure change in tandem along the equilibrium line, we can write:$$dG_{vapor}=-S_{vapor}dT+V_{vapor}dP$$and
$$dG_{liquid}=-S_{liquid}dT+V_{liquid}dP$$Since, along the equilibrium line, we must have $dG_{vapor}=dG_{liquid}$, we can write:$$-S_{vapor}dT+V_{vapor}dP=-S_{liquid}dT+V_{liquid}dP$$or equivalently:$$\frac{dP}{dT}=\frac{(S_{vapor}-S_{liquid})}{(V_{vapor}-V_{liquid})}=\frac{(H_{vapor}-H_{liquid})}{T(V_{vapor}-V_{liquid})}$$This is the Clapeyron equation.