First note that $e^{j\pi n}=(-1)^n$. Furthermore, note that $u[n]-u[n-N]$ is a rectangular impulse of width $N$.
Now, you can calculate
$$
\textrm{DTFT}\left\{u[n]-u[n-N])\right\} = \sum_{n=0}^{N-1}e^{-j2\pi nf}=\frac{1-e^{-j2\pi Nf}}{1-e^{-j2\pi f}}
$$
which is the rule for the geometric sum.
Furthermore, you will find
$$
\textrm{DTFT}\left\{\exp{(j\pi n)}\right\}=\delta\left(f-\frac{1}{2}\right)
$$
Finally, the result follows from the convolution theorem, i.e. multiplication in time becomes convolution in frequency:
$$
\textrm{DTFT}\left\{\exp({j\pi n})(u[n]-u[n-N])\right\}=\delta\left(f-\frac{1}{2}\right)\star\frac{1-e^{-j2\pi Nf}}{1-e^{-j2\pi f}}=\frac{1-e^{-j2\pi N(f-\frac{1}{2})}}{1-e^{-j2\pi (f-\frac{1}{2})}}
$$