Skip to content

Instantly share code, notes, and snippets.

@tsabat
Created October 26, 2011 18:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsabat/1317392 to your computer and use it in GitHub Desktop.
Save tsabat/1317392 to your computer and use it in GitHub Desktop.
Python Project Setup
AUTHOR='timothy sabat'
EMAIL='timothy.sabat@gmail.com'
mkdir $1
cd $1
mkdir bin $1 tests docs
touch $1/__init__.py
touch tests/__init__.py
cat > setup.py <<End-of-message
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': '',
'author': '$AUTHOR',
'url': '',
'download_url': '',
'author_email': '$EMAIL',
'version': '1.0',
'install_requires': ['nose'],
'packages': ['name'],
'scripts': [],
'name': '$1'
}
setup(**config)
End-of-message
cat > "tests/$1"_tests.py <<End-of-message
from nose.tools import *
import $1
def setup():
print 'SETUP!'
def teardown():
print 'TEARDOWN!"
def test_basic():
print 'I RAN!'
End-of-message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment