Browse files

Add setup.py and related stuff

  • Loading branch information...
1 parent 64e5529 commit f37486284c9386bb022eb6ed127989c933393cfe @j4mie committed Dec 28, 2010
Showing with 47 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +3 −0 MANIFEST.in
  3. +2 −0 micromodels/__init__.py
  4. +39 −0 setup.py
View
3 .gitignore
@@ -1,3 +1,6 @@
*.pyc
*.swp
.DS_Store
+build
+dist
+MANIFEST
View
3 MANIFEST.in
@@ -0,0 +1,3 @@
+include README.md
+include UNLICENSE
+include tests.py
View
2 micromodels/__init__.py
@@ -1,3 +1,5 @@
from models import Model
from fields import PassField, CharField, IntegerField, BooleanField, DateTimeField, DateField, \
TimeField, ModelField, ModelCollectionField, FieldCollectionField
+
+__version__ = '0.0.1'
View
39 setup.py
@@ -0,0 +1,39 @@
+import os
+import re
+from distutils.core import setup
+
+rel_file = lambda *args: os.path.join(os.path.dirname(os.path.abspath(__file__)), *args)
+
+def read_from(filename):
+ fp = open(filename)
+ try:
+ return fp.read()
+ finally:
+ fp.close()
+
+def get_long_description():
+ return read_from(rel_file('README.md'))
+
+def get_version():
+ data = read_from(rel_file('micromodels/__init__.py'))
+ return re.search(r"__version__ = '([^']+)'", data).group(1)
+
+setup(
+ name='micromodels',
+ description='Declarative dictionary-based read-only model classes for Python',
+ long_description=get_long_description(),
+ version=get_version(),
+ packages=['micromodels'],
+ url='https://github.com/j4mie/micromodels/',
+ author='Jamie Matthews',
+ author_email='jamie.matthews@gmail.com',
+ license='Public Domain',
+ classifiers = [
+ 'Programming Language :: Python',
+ 'Development Status :: 3 - Alpha',
+ 'Intended Audience :: Developers',
+ 'License :: Public Domain',
+ 'Operating System :: OS Independent',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ ],
+)

0 comments on commit f374862

Please sign in to comment.