Skip to content

Commit

Permalink
Added trivial version
Browse files Browse the repository at this point in the history
- Added test for empty parse
- Added version info
- Added setup.py
- Added parser that always returns empty
  • Loading branch information
davidfischer committed Nov 24, 2012
1 parent 0a0e4d7 commit 168d8c1
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 0 deletions.
21 changes: 21 additions & 0 deletions reqfileparser/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from .parser import parse

_MAJOR = 0
_MINOR = 0
_PATCH = 1

def version_tuple():
'''
Returns a 3-tuple of ints that represent the version
'''
return (_MAJOR, _MINOR, _PATCH)

def version():
'''
Returns a string representation of the version
'''
return '%d.%d.%d' %(version_tuple())


__version__ = version()

5 changes: 5 additions & 0 deletions reqfileparser/parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def parse(reqstr):
if not isinstance(reqstr, basestring):
reqstr = reqstr.read()

return []
30 changes: 30 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
try:
from setuptools import setup
except ImportError:
from distutils.core import setup

long_description = open('README.rst').read()

setup(
name = 'reqfile-parser',
version = '0.0.1',
description = 'Parses Pip requirement files',
long_description = long_description,
author = 'David Fischer',
author_email = '[email protected]',
url = 'https://github.com/davidfischer/reqfile-parser',
license = 'BSD',
platforms = ['OS Independent'],
packages = ['reqfileparser'],
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Software Development :: Libraries :: Python Modules',
],
test_suite='tests',
)
Empty file added tests/__init__.py
Empty file.
7 changes: 7 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import unittest
from reqfileparser import parse

class TestParser(unittest.TestCase):
def test_empty(self):
self.assertEqual(parse(''), [])

0 comments on commit 168d8c1

Please sign in to comment.