I can link to the code, it's a combination of normal debian package creation, the "rules" file inside of the ``debian`` folder in the Warehouse repository, and dh-virtualenv which is a debianhelper script that does the heavy lifting of virtualenv creation and pip installation.