# mementos / setup.py

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73``` ```#! /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.467"), 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 Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: PyPy Topic :: Software Development :: Libraries :: Python Modules """) ) ```