Hackers just wanna have fun

People often ask me why, if I love coding so much, I haven’t pursued a career in software development. I shrug and tell them I’m a hacker. Being a pro developer would take all the fun out of it because I’d have to follow ‘best practices’ (screw you PEP8), ‘architect’ solutions, do code reviews, use JIRA, and numerous other things that would kill my vibe.

Think about movie critics. In theory, they have the best job ever: watching movies all day. But, they’re incapable of enjoying mindless action flicks like The Fast & Furious because they have to focus on things like plot, character development, and the Bechdel Test.

This is all my way of saying, I’ve never used virtualenv when writing Python apps. I just pip install modules globally and get to hacking. And that’s great because I never have to think about “did I install x?”—at least until it’s time to deploy to Heroku.

Fortunately, I found another hacker out there who appreciates my philosophy. Vadim Kravcenko’s pipreqs module generates requirements.txt files based on the libraries you’re using, not just what you’ve installed in your environment (🖕 pip freeze).

For example, my latest project has a lots imports spread across 3 or 4 source files:

```python from flask import request, session, Flask, render_template, Response, redirect, url_for from flask_cors import CORS, cross_origin import requests import json import re import random from os import environ import string from datetime import datetime

import twilio import twilio.rest from twilio.rest.lookups import TwilioLookupsClient import twilio.twiml

from sqlalchemy import * from sqlalchemy.exc import IntegrityError from sqlalchemy.exc import CompileError from sqlalchemy.orm import sessionmaker, deferred from sqlalchemy.ext.declarative import declarative_base

import cloudinary import cloudinary.uploader import cloudinary.api ```

But with pipreqs, I can run pipreqs ~/path/to/app and I get a perfectly formatted requirements file:

cloudinary==1.4.0 Flask==0.11.1 Flask_Cors==2.1.2 requests==2.10.0 SQLAlchemy==0.9.4 twilio==3.8.0

Did I just blow your little best practice, rule following, PEP addicted mind? Thought so. 😎

2017 Neal Shyam