Improved package detection in setup.py