mementos / setup.py

Jonathan Eunice feb9b3a 


Jonathan Eunice 670ffad 
Jonathan Eunice feb9b3a 



















Jonathan Eunice 670ffad 


Jonathan Eunice feb9b3a 








Jonathan Eunice 670ffad 








Jonathan Eunice feb9b3a 

Jonathan Eunice 670ffad 
Jonathan Eunice feb9b3a 



Jonathan Eunice fa8ca9b 
Jonathan Eunice feb9b3a 

Jonathan Eunice 670ffad 

Jonathan Eunice feb9b3a 





Jonathan Eunice 670ffad 




Jonathan Eunice feb9b3a 

#! /usr/bin/env python

from setuptools import setup
import sys

def linelist(text):
    """
    Returns each non-blank line in text enclosed in a list.
    """
    return [ l.strip() for l in text.strip().splitlines() if l.split() ]
    
    # The double-mention of l.strip() is yet another fine example of why
    # Python needs en passant aliasing.


def verno(s):
    """
    Update the version number passed in by extending it to the 
    thousands place and adding 1/1000, then returning that result
    and as a side-effect updating setup.py

    Dangerous, self-modifying, and also, helps keep version numbers
    ascending without human intervention.
    """
    from decimal import Decimal
    import re 

    d = Decimal(s)
    increment = Decimal('0.001')
    d = d.quantize(increment) + increment
    dstr = str(d)
    setup = open('setup.py', 'r').read()
    setup = re.sub('verno\(\w*[\'"]([\d\.]+)[\'"]', 'verno("' + dstr + '"', setup)
    open('setup.py', 'w').write(setup)
    return dstr

def linelist(text):
    """
    Returns each non-blank line in text enclosed in a list.
    """
    return [ l.strip() for l in text.strip().splitlines() if l.split() ]
    
    # The double-mention of l.strip() is yet another fine example of why
    # Python needs en passant aliasing.

setup(
    name='mementos',
    version=verno("0.404"),
    author='Jonathan Eunice',
    author_email='jonathan.eunice@gmail.com',
    description='Memoizing metaclass. Drop-dead simple way to create cached objects',
    long_description=open('README.rst').read(),
    url='https://bitbucket.org/jeunice/mementos',
    py_modules=['mementos'],
    install_requires=[],
    tests_require = ['tox', 'pytest'],
    zip_safe = True,
    classifiers=linelist("""
        Development Status :: 4 - Beta
        Operating System :: OS Independent
        License :: OSI Approved :: BSD License
        Intended Audience :: Developers
        Programming Language :: Python
        Programming Language :: Python :: 2.5
        Programming Language :: Python :: 2.6
        Programming Language :: Python :: 2.7
        Programming Language :: Python :: 3.2
        Programming Language :: Python :: 3.3
        Topic :: Software Development :: Libraries :: Python Modules
    """)
)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.