Optimize setup.py

All imports on each line
generator func loop optimization.
less dots in loop