#!/usr/bin/env python
from setuptools import setup
setup(
  name = 'cs.py.func',
  author = 'Cameron Simpson',
  author_email = 'cs@cskk.id.au',
  version = '20210913',
  url = 'https://bitbucket.org/cameron_simpson/css/commits/all',
  description =
    'Convenience facilities related to Python functions.',
  long_description =
    ('Convenience facilities related to Python functions.\n'    
 '\n'    
 '*Latest release 20210913*:\n'    
 'New func_a_kw_fmt(func,*a,**kw) imported from cs.pfx, hooked it into '    
 '@trace.\n'    
 '\n'    
 '## Function `callmethod_if(o, method, default=None, a=None, kw=None)`\n'    
 '\n'    
 'Call the named `method` on the object `o` if it exists.\n'    
 '\n'    
 'If it does not exist, return `default` (which defaults to None).\n'    
 'Otherwise call getattr(o, method)(*a, **kw).\n'    
 '`a` defaults to ().\n'    
 '`kw` defaults to {}.\n'    
 '\n'    
 '## Function `derived_from(property_name)`\n'    
 '\n'    
 'A property which must be recomputed\n'    
 'if the revision of another property exceeds the snapshot revision.\n'    
 '\n'    
 "## Function `derived_property(func, original_revision_name='_revision', "    
 "lock_name='_lock', property_name=None, unset_object=None)`\n"    
 '\n'    
 'A property which must be recomputed\n'    
 'if the reference revision (attached to self)\n'    
 'exceeds the snapshot revision.\n'    
 '\n'    
 '## Function `func_a_kw_fmt(func, *a, **kw)`\n'    
 '\n'    
 'Prepare a percent-format string and associated argument list\n'    
 'describing a call to `func(*a,**kw)`.\n'    
 'Return `format,args`.\n'    
 '\n'    
 'The `func` argument can also be a string,\n'    
 'presumably a prepared description of `func` such as `funccite(func)`.\n'    
 '\n'    
 '## Function `funccite(func)`\n'    
 '\n'    
 'Return a citation for a function (name and code location).\n'    
 '\n'    
 '## Function `funcname(func)`\n'    
 '\n'    
 'Return a name for the supplied function `func`.\n'    
 'Several objects do not have a __name__ attribute, such as partials.\n'    
 '\n'    
 '## Function `prop(func)`\n'    
 '\n'    
 'A substitute for the builtin @property.\n'    
 '\n'    
 'The builtin @property decorator lets internal AttributeErrors escape.\n'    
 'While that can support properties that appear to exist conditionally,\n'    
 'in practice this is almost never what I want, and it masks deeper errors.\n'    
 'Hence this wrapper for @property that transmutes internal AttributeErrors\n'    
 'into RuntimeErrors.\n'    
 '\n'    
 '## Function `returns_bool(func)`\n'    
 '\n'    
 'Decorator for functions which should return Booleans.\n'    
 '\n'    
 '## Function `returns_str(func)`\n'    
 '\n'    
 'Decorator for functions which should return strings.\n'    
 '\n'    
 '## Function `returns_type(func, basetype)`\n'    
 '\n'    
 'Decrator which checks that a function returns values of type `basetype`.\n'    
 '\n'    
 '## Function `trace(*da, **dkw)`\n'    
 '\n'    
 'Decorator to report the call and return of a function.\n'    
 '\n'    
 '## Function `yields_str(func)`\n'    
 '\n'    
 'Decorator for generators which should yield strings.\n'    
 '\n'    
 '## Function `yields_type(func, basetype)`\n'    
 '\n'    
 'Decorator which checks that a generator yields values of type `basetype`.\n'    
 '\n'    
 '# Release Log\n'    
 '\n'    
 '\n'    
 '\n'    
 '*Release 20210913*:\n'    
 'New func_a_kw_fmt(func,*a,**kw) imported from cs.pfx, hooked it into '    
 '@trace.\n'    
 '\n'    
 '*Release 20210906*:\n'    
 'funcname: special case functools.partial, return concise name.\n'    
 '\n'    
 '*Release 20210717*:\n'    
 '* Move @trace from debug to py.func, defer log call imports to avoid loops.\n'    
 '* Drop cs.pfx requirement, import opportunisticly with fallback.\n'    
 '\n'    
 '*Release 20200518*:\n'    
 'funcname: prefer `func.__qualname__` over `func.__name__`\n'    
 '\n'    
 '*Release 20190729*:\n'    
 'funccite: handle callables with no __code__ attribute.\n'    
 '\n'    
 '*Release 20190108*:\n'    
 'Break import loop. Use cs.py3.raise_from for portability.\n'    
 '\n'    
 '*Release 20181231*:\n'    
 '* Some type specific convenience wrappers for yields_type and returns_type.\n'    
 '* Bugfix for @prop.\n'    
 '\n'    
 '*Release 20170906.1*:\n'    
 'Minor tweaks.\n'    
 '\n'    
 '*Release 20170906*:\n'    
 'Bugfix for @prop.\n'    
 '\n'    
 '*Release 20170608*:\n'    
 'New decorator @prop which works just like the builtin @property, but '    
 'transmutes internal AttributeError into RuntimeError, unmasking many bugs.\n'    
 '\n'    
 '*Release 20160828*:\n'    
 'Use "install_requires" instead of "requires" in DISTINFO.\n'    
 '\n'    
 '*Release 20150115*:\n'    
 'First PyPI release.'),
  install_requires = ['cs.deco', 'cs.py3', 'cs.x'],
  classifiers = ['Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Topic :: Software Development :: Libraries :: Python Modules', 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)'],
  keywords = ['python2', 'python3'],
  license = 'GNU General Public License v3 or later (GPLv3+)',
  long_description_content_type = 'text/markdown',
  package_dir = {'': 'lib/python'},
  py_modules = ['cs.py.func'],
)
