Python Package: Difference between revisions
From charlesreid1
No edit summary |
No edit summary |
||
| Line 57: | Line 57: | ||
print "i run good" | print "i run good" | ||
</pre> | </pre> | ||
=References= | |||
[[Category:Python]] | |||
Revision as of 01:04, 19 March 2015
myproject/
setup.py
myproject/
__init__.py
code.py
submodule/
somecode.py
morecode.py
tests/
test_code.py
test_somecode.py
test_morecode.py
Setup.py
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'My Project',
'author': 'My Name',
'url': 'URL to get it at.',
'download_url': 'Where to download it.',
'author_email': 'My email.',
'version': '0.1',
'install_requires': ['nose'],
'packages': ['NAME'],
'scripts': [],
'name': 'projectname'
}
setup(**config)
Test_code.py
from nose.tools import *
import NAME
def setup():
print "setup"
def teardown():
print "tear down"
def test_basic():
print "i run good"