Created
October 26, 2011 18:52
-
-
Save tsabat/1317392 to your computer and use it in GitHub Desktop.
Python Project Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AUTHOR='timothy sabat' | |
EMAIL='[email protected]' | |
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