diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..6e660046 --- /dev/null +++ b/.gitignore @@ -0,0 +1,65 @@ +# Created by https://www.gitignore.io + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + + +dill/LICENSE +dill/README.rst +dill/_version.py diff --git a/.travis.yml b/.travis.yml index 0c433d5f..a4629ed7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,8 @@ sudo: false matrix: include: - - python: '2.5' - python: '2.6' - python: '2.7' - - python: '3.1' - - python: '3.2' - python: '3.3' - python: '3.4' - python: '3.5' @@ -17,8 +14,6 @@ matrix: - python: 'pypy' - python: 'pypy3' allow_failures: - - python: '2.5' - - python: '3.1' - python: '3.5' - python: '3.6' - python: 'nightly' @@ -31,9 +26,10 @@ cache: before_install: - set -e # fail on any error + - pip install -U pip setuptools install: - - python setup.py build && python setup.py install + - python setup.py install script: - for test in tests/*.py; do echo $test ; python $test > /dev/null ; done diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index 70b1172b..00000000 --- a/MANIFEST +++ /dev/null @@ -1,42 +0,0 @@ -LICENSE -MANIFEST -README -README.md -setup.cfg -setup.py -dill/__diff.py -dill/__init__.py -dill/_objects.py -dill/detect.py -dill/dill.py -dill/info.py -dill/objtypes.py -dill/pointers.py -dill/settings.py -dill/source.py -dill/temp.py -dill.egg-info/PKG-INFO -dill.egg-info/SOURCES.txt -dill.egg-info/dependency_links.txt -dill.egg-info/not-zip-safe -dill.egg-info/requires.txt -dill.egg-info/top_level.txt -scripts/get_objgraph.py -scripts/unpickle.py -tests/dill_bugs.py -tests/test_check.py -tests/test_classdef.py -tests/test_detect.py -tests/test_diff.py -tests/test_extendpickle.py -tests/test_file.py -tests/test_functors.py -tests/test_mixins.py -tests/test_module.py -tests/test_moduledict.py -tests/test_nested.py -tests/test_objects.py -tests/test_properties.py -tests/test_source.py -tests/test_temp.py -tests/test_weakref.py diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..66f0c579 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include DEV_NOTES +include README.rst +include LICENSE diff --git a/README.md b/README.rst similarity index 64% rename from README.md rename to README.rst index 33a2c7cf..5c1f4362 100644 --- a/README.md +++ b/README.rst @@ -1,122 +1,169 @@ -dill -==== -serialize all of python - -About Dill ----------- -`dill` extends python's `pickle` module for serializing and de-serializing -python objects to the majority of the built-in python types. Serialization -is the process of converting an object to a byte stream, and the inverse -of which is converting a byte stream back to on python object hierarchy. - -`dill` provides the user the same interface as the `pickle` module, and -also includes some additional features. In addition to pickling python -objects, `dill` provides the ability to save the state of an interpreter -session in a single command. Hence, it would be feasable to save a -interpreter session, close the interpreter, ship the pickled file to -another computer, open a new interpreter, unpickle the session and -thus continue from the 'saved' state of the original interpreter -session. - -`dill` can be used to store python objects to a file, but the primary -usage is to send python objects across the network as a byte stream. -`dill` is quite flexible, and allows arbitrary user defined classes -and funcitons to be serialized. Thus `dill` is not intended to be -secure against erroneously or maliciously constructed data. It is -left to the user to decide whether the data they unpickle is from -a trustworthy source. - -`dill` is part of `pathos`, a python framework for heterogeneous computing. -`dill` is in active development, so any user feedback, bug reports, comments, -or suggestions are highly appreciated. A list of known issues is maintained -at http://trac.mystic.cacr.caltech.edu/project/pathos/query, with a public -ticket list at https://github.com/uqfoundation/dill/issues. - - -Major Features --------------- -`dill` can pickle the following standard types:: - -* none, type, bool, int, long, float, complex, str, unicode, -* tuple, list, dict, file, buffer, builtin, -* both old and new style classes, -* instances of old and new style classes, -* set, frozenset, array, functions, exceptions - -`dill` can also pickle more 'exotic' standard types:: - -* functions with yields, nested functions, lambdas -* cell, method, unboundmethod, module, code, methodwrapper, -* dictproxy, methoddescriptor, getsetdescriptor, memberdescriptor, -* wrapperdescriptor, xrange, slice, -* notimplemented, ellipsis, quit - -`dill` cannot yet pickle these standard types:: - -* frame, generator, traceback - -`dill` also provides the capability to:: - -* save and load python interpreter sessions -* save and extract the source code from functions and classes -* interactively diagnose pickling errors - - -Current Release ---------------- -The latest released version of `dill` is available from:: - http://trac.mystic.cacr.caltech.edu/project/pathos - -or:: - https://github.com/uqfoundation/dill/releases - -or also:: - https://pypi.python.org/pypi/dill - -`dill` is distributed under a 3-clause BSD license. - - -Development Version -------------------- -You can get the latest development version with all the shiny new features at:: - https://github.com/uqfoundation - -If you have a new contribution, please submit a pull request. - - -More Information ----------------- -Probably the best way to get started is to look at the tests that are -provide within `dill`. See `dill.tests` for a set of scripts that demonstrate -how `dill` can serialize different python objects. Since `dill` conforms -to the `pickle` interface, the examples and documentation at -http://docs.python.org/library/pickle.html also apply to `dill` if one will -`import dill as pickle`. The source code is also generally well documented, -so further questions may be resolved by inspecting the code itself. Please -also feel free to submit a ticket on github, or ask a question on -stackoverflow (@Mike McKerns). - -`dill` is an active research tool. There are a growing number of publications -and presentations that discuss real-world examples and new features of `dill` -in greater detail than presented in the user's guide. If you would like to -share how you use `dill` in your work, please post a link or send an email -(to mmckerns at uqfoundation dot org). - - -Citation --------- -If you use `dill` to do research that leads to publication, we ask that you -acknowledge use of `dill` by citing the following in your publication:: - - M.M. McKerns, L. Strand, T. Sullivan, A. Fang, M.A.G. Aivazis, - "Building a framework for predictive science", Proceedings of - the 10th Python in Science Conference, 2011; - http://arxiv.org/pdf/1202.1056 - - Michael McKerns and Michael Aivazis, - "pathos: a framework for heterogeneous computing", 2010- ; - http://dev.danse.us/trac/pathos - -Please see http://trac.mystic.cacr.caltech.edu/project/pathos or -http://arxiv.org/pdf/1202.1056 for further information. - +----------------------------- +dill: serialize all of python +----------------------------- + +About Dill +========== + +`dill` extends python's `pickle` module for serializing and de-serializing +python objects to the majority of the built-in python types. Serialization +is the process of converting an object to a byte stream, and the inverse +of which is converting a byte stream back to on python object hierarchy. + +`dill` provides the user the same interface as the `pickle` module, and +also includes some additional features. In addition to pickling python +objects, `dill` provides the ability to save the state of an interpreter +session in a single command. Hence, it would be feasable to save a +interpreter session, close the interpreter, ship the pickled file to +another computer, open a new interpreter, unpickle the session and +thus continue from the 'saved' state of the original interpreter +session. + +`dill` can be used to store python objects to a file, but the primary +usage is to send python objects across the network as a byte stream. +`dill` is quite flexible, and allows arbitrary user defined classes +and funcitons to be serialized. Thus `dill` is not intended to be +secure against erroneously or maliciously constructed data. It is +left to the user to decide whether the data they unpickle is from +a trustworthy source. + +`dill` is part of `pathos`, a python framework for heterogeneous computing. +`dill` is in active development, so any user feedback, bug reports, comments, +or suggestions are highly appreciated. A list of known issues is maintained +at http://trac.mystic.cacr.caltech.edu/project/pathos/query, with a public +ticket list at https://github.com/uqfoundation/dill/issues. + + +Major Features +============== + +`dill` can pickle the following standard types: + +* none, type, bool, int, long, float, complex, str, unicode, +* tuple, list, dict, file, buffer, builtin, +* both old and new style classes, +* instances of old and new style classes, +* set, frozenset, array, functions, exceptions + +`dill` can also pickle more 'exotic' standard types: + +* functions with yields, nested functions, lambdas, +* cell, method, unboundmethod, module, code, methodwrapper, +* dictproxy, methoddescriptor, getsetdescriptor, memberdescriptor, +* wrapperdescriptor, xrange, slice, +* notimplemented, ellipsis, quit + +`dill` cannot yet pickle these standard types: + +* frame, generator, traceback + +`dill` also provides the capability to: + +* save and load python interpreter sessions +* save and extract the source code from functions and classes +* interactively diagnose pickling errors + + +Current Release +=============== + +The latest released version of `dill` is available from: + +* http://trac.mystic.cacr.caltech.edu/project/pathos + +or: + +* https://github.com/uqfoundation/dill/releases + +or also: + +* https://pypi.python.org/pypi/dill + +`dill` is distributed under a 3-clause BSD license:: + + >>> import dill + >>> print (dill.license()) + + +Development Version +=================== + +You can get the latest development version with all the shiny new features at: + +* https://github.com/uqfoundation/dill/ + +If you have a new contribution, please submit a pull request. + + +Installation +============ + +`dill` is packaged to install from source, so you must +download the tarball, unzip, and run the installer:: + + [download] + $ tar -xvzf dill-%(thisver)s.tgz + $ cd dill-%(thisver)s + $ python setup py build + $ python setup py install + +You will be warned of any missing dependencies and/or settings +after you run the "build" step above. + +Alternately, `dill` can be installed with `pip` or `easy_install`:: + + $ pip install dill + + +Requirements +============ + +`dill` requires: + +* python2, version >= 2.5 *or* python3, version >= 3.1 +* pyreadline, version >= 1.7.1 (on windows) + +Optional requirements: + +* setuptools, version >= 0.6 +* objgraph, version >= 1.7.2 + + +More Information +================ + +Probably the best way to get started is to look at the tests that are +provided within `dill`. See `dill.tests` for a set of scripts that demonstrate +how `dill` can serialize different python objects. Since `dill` conforms +to the `pickle` interface, the examples and documentation at +http://docs.python.org/library/pickle.html also apply to `dill` if one will +`import dill as pickle`. The source code is also generally well +documented, so further questions may be resolved by inspecting the code +itself. Please also feel free to submit a ticket on github, or ask a +question on stackoverflow (@Mike McKerns). + +`dill` is an active research tool. There are a growing number of publications +and presentations that discuss real-world examples and new features of `dill` +in greater detail than presented in the user's guide. If you would like to +share how you use `dill` in your work, please post a link or send an email +(to mmckerns at uqfoundation dot org). + + +Citation +======== + +If you use `dill` to do research that leads to publication, we ask that you +acknowledge use of `dill` by citing the following in your publication:: + + M.M. McKerns, L. Strand, T. Sullivan, A. Fang, M.A.G. Aivazis, + "Building a framework for predictive science", Proceedings of + the 10th Python in Science Conference, 2011; + http://arxiv.org/pdf/1202.1056 + + Michael McKerns and Michael Aivazis, + "pathos: a framework for heterogeneous computing", 2010- ; + http://trac.mystic.cacr.caltech.edu/project/pathos + +Please see http://trac.mystic.cacr.caltech.edu/project/pathos or +http://arxiv.org/pdf/1202.1056 for further information. + diff --git a/dill/__init__.py b/dill/__init__.py index 0fc7278e..1ebcedff 100644 --- a/dill/__init__.py +++ b/dill/__init__.py @@ -8,12 +8,8 @@ from __future__ import absolute_import # get version numbers, license, and long description -try: - from .info import this_version as __version__ - from .info import readme as __doc__, license as __license__ -except ImportError: - msg = """First run 'python setup.py build' to build dill.""" - raise ImportError(msg) +from ._version import version as __version__ +from .info import readme as __doc__, license as __license__ __author__ = 'Mike McKerns' @@ -27,19 +23,13 @@ Pickler, Unpickler, register, copy, pickle, pickles, check, \ HIGHEST_PROTOCOL, DEFAULT_PROTOCOL, PicklingError, UnpicklingError, \ HANDLE_FMODE, CONTENTS_FMODE, FILE_FMODE -from . import source, temp, detect -# get global settings +from . import source, temp, detect from .settings import settings # make sure "trace" is turned off detect.trace(False) -try: - from imp import reload -except ImportError: - pass - # put the objects in order, if possible try: from collections import OrderedDict as odict @@ -49,6 +39,7 @@ except ImportError: odict = dict objects = odict() + # local import of dill._objects #from . import _objects #objects.update(_objects.succeeds) @@ -61,6 +52,8 @@ def load_types(pickleable=True, unpickleable=True): """load pickleable and/or unpickleable types to dill.types""" # local import of dill.objects from . import _objects + + from imp import reload if pickleable: objects.update(_objects.succeeds) else: @@ -80,23 +73,19 @@ def load_types(pickleable=True, unpickleable=True): def extend(use_dill=True): '''add (or remove) dill types to/from pickle''' from .dill import _revert_extension, _extend - if use_dill: _extend() - else: _revert_extension() - return + if use_dill: + _extend() + else: + _revert_extension() extend() def license(): """print license""" - print (__license__) - return + print(__license__) def citation(): """print citation""" - print (__doc__[-501:-123]) - return + print(__doc__[-501:-123]) -del absolute_import del odict - -# end of file diff --git a/scripts/get_objgraph.py b/dill/get_objgraph.py similarity index 95% rename from scripts/get_objgraph.py rename to dill/get_objgraph.py index b16f95f8..de84f012 100644 --- a/scripts/get_objgraph.py +++ b/dill/get_objgraph.py @@ -14,11 +14,10 @@ #import pickle # get all objects for testing -from dill import load_types +from . import load_types, objects load_types(pickleable=True,unpickleable=True) -from dill import objects -if __name__ == "__main__": +def main(): import sys if len(sys.argv) != 2: print ("Please provide exactly one type name (e.g. 'IntType')") @@ -35,5 +34,8 @@ except ImportError: print ("Please install 'objgraph' to view object graphs") +if __name__ == "__main__": + main() + # EOF diff --git a/scripts/__init__.py b/dill/info.py similarity index 54% rename from scripts/__init__.py rename to dill/info.py index f460aaf6..f233dfbf 100644 --- a/scripts/__init__.py +++ b/dill/info.py @@ -1,6 +1,14 @@ -# Author: Mike McKerns (mmckerns @caltech and @uqfoundation) -# Copyright (c) 2008-2016 California Institute of Technology. -# License: 3-clause BSD. The full license text is available at: -# - http://trac.mystic.cacr.caltech.edu/project/pathos/browser/dill/LICENSE -# -# dummy __init__ file for dill scripts +# Author: Mike McKerns (mmckerns @caltech and @uqfoundation) +# Copyright (c) 2008-2016 California Institute of Technology. +# License: 3-clause BSD. The full license text is available at: +# - http://trac.mystic.cacr.caltech.edu/project/pathos/browser/dill/LICENSE + +from os import path + +_here = path.abspath(path.dirname(__file__)) + +with open(path.join(_here, 'README.rst')) as f: + readme = f.read() + +with open(path.join(_here, 'LICENSE')) as f: + license = f.read() diff --git a/scripts/unpickle.py b/dill/unpickle.py similarity index 65% rename from scripts/unpickle.py rename to dill/unpickle.py index 610c5934..aab6631b 100644 --- a/scripts/unpickle.py +++ b/dill/unpickle.py @@ -5,9 +5,13 @@ # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/project/pathos/browser/dill/LICENSE -if __name__ == '__main__': - import sys - import dill - for file in sys.argv[1:]: - print (dill.load(open(file,'r'))) +from __future__ import print_function + +def main(): + import sys + from . import load + for file in sys.argv[1:]: + print(load(open(file,'r'))) +if __name__ == '__main__': + main() diff --git a/setup.cfg b/setup.cfg index 46edaabe..3c6e79cf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,4 +1,2 @@ -[egg_info] -tag_build = .dev0 -#tag_svn_revision = yes -#tag_date = yes +[bdist_wheel] +universal=1 diff --git a/setup.py b/setup.py index a89a6daa..93d7d182 100644 --- a/setup.py +++ b/setup.py @@ -5,311 +5,63 @@ # License: 3-clause BSD. The full license text is available at: # - http://trac.mystic.cacr.caltech.edu/project/pathos/browser/dill/LICENSE -from __future__ import with_statement, absolute_import -import os +from __future__ import absolute_import -# set version numbers -stable_version = '0.2.5' -target_version = '0.2.6' -is_release = stable_version == target_version +from os import path +from setuptools import setup, find_packages +from distutils.file_util import copy_file -# check if easy_install is available -try: -# import __force_distutils__ #XXX: uncomment to force use of distutills - from setuptools import setup - has_setuptools = True -except ImportError: - from distutils.core import setup - has_setuptools = False +_here = path.abspath(path.dirname(__file__)) -# generate version number -if os.path.exists('dill/info.py'): - # is a source distribution, so use existing version - os.chdir('dill') - with open('info.py','r') as f: - f.readline() # header - this_version = f.readline().split()[-1].strip("'") - os.chdir('..') -elif stable_version == target_version: - # we are building a stable release - this_version = target_version -else: - # we are building a distribution - this_version = target_version + '.dev0' - if is_release: - from datetime import date - today = "".join(date.isoformat(date.today()).split('-')) - this_version += "-" + today +copy_file(path.join(_here, 'README.rst'), path.join(_here, 'dill')) +copy_file(path.join(_here, 'LICENSE'), path.join(_here, 'dill')) -# get the license info -with open('LICENSE') as file: - license_text = file.read() - -# generate the readme text -long_description = \ -"""----------------------------- -dill: serialize all of python ------------------------------ - -About Dill -========== - -`dill` extends python's `pickle` module for serializing and de-serializing -python objects to the majority of the built-in python types. Serialization -is the process of converting an object to a byte stream, and the inverse -of which is converting a byte stream back to on python object hierarchy. - -`dill` provides the user the same interface as the `pickle` module, and -also includes some additional features. In addition to pickling python -objects, `dill` provides the ability to save the state of an interpreter -session in a single command. Hence, it would be feasable to save a -interpreter session, close the interpreter, ship the pickled file to -another computer, open a new interpreter, unpickle the session and -thus continue from the 'saved' state of the original interpreter -session. - -`dill` can be used to store python objects to a file, but the primary -usage is to send python objects across the network as a byte stream. -`dill` is quite flexible, and allows arbitrary user defined classes -and funcitons to be serialized. Thus `dill` is not intended to be -secure against erroneously or maliciously constructed data. It is -left to the user to decide whether the data they unpickle is from -a trustworthy source. - -`dill` is part of `pathos`, a python framework for heterogeneous computing. -`dill` is in active development, so any user feedback, bug reports, comments, -or suggestions are highly appreciated. A list of known issues is maintained -at http://trac.mystic.cacr.caltech.edu/project/pathos/query, with a public -ticket list at https://github.com/uqfoundation/dill/issues. - - -Major Features -============== - -`dill` can pickle the following standard types:: - - - none, type, bool, int, long, float, complex, str, unicode, - - tuple, list, dict, file, buffer, builtin, - - both old and new style classes, - - instances of old and new style classes, - - set, frozenset, array, functions, exceptions - -`dill` can also pickle more 'exotic' standard types:: - - - functions with yields, nested functions, lambdas, - - cell, method, unboundmethod, module, code, methodwrapper, - - dictproxy, methoddescriptor, getsetdescriptor, memberdescriptor, - - wrapperdescriptor, xrange, slice, - - notimplemented, ellipsis, quit - -`dill` cannot yet pickle these standard types:: - - - frame, generator, traceback - -`dill` also provides the capability to:: - - - save and load python interpreter sessions - - save and extract the source code from functions and classes - - interactively diagnose pickling errors - - -Current Release -=============== - -This version is `dill-%(relver)s`. - -The latest released version of `dill` is available from:: - - http://trac.mystic.cacr.caltech.edu/project/pathos - -or:: - - https://github.com/uqfoundation/dill/releases - -or also:: - - https://pypi.python.org/pypi/dill - -`dill` is distributed under a 3-clause BSD license. - - >>> import dill - >>> print (dill.license()) - - -Development Version -=================== - -You can get the latest development version with all the shiny new features at:: - - https://github.com/uqfoundation - -If you have a new contribution, please submit a pull request. - - -Installation -============ - -`dill` is packaged to install from source, so you must -download the tarball, unzip, and run the installer:: - - [download] - $ tar -xvzf dill-%(thisver)s.tgz - $ cd dill-%(thisver)s - $ python setup py build - $ python setup py install - -You will be warned of any missing dependencies and/or settings -after you run the "build" step above. - -Alternately, `dill` can be installed with `pip` or `easy_install`:: - - $ pip install dill - - -Requirements -============ - -`dill` requires:: - - - python2, version >= 2.5 *or* python3, version >= 3.1 - - pyreadline, version >= 1.7.1 (on windows) - -Optional requirements:: - - - setuptools, version >= 0.6 - - objgraph, version >= 1.7.2 - - -More Information -================ - -Probably the best way to get started is to look at the tests that are -provided within `dill`. See `dill.tests` for a set of scripts that demonstrate -how `dill` can serialize different python objects. Since `dill` conforms -to the `pickle` interface, the examples and documentation at -http://docs.python.org/library/pickle.html also apply to `dill` if one will -`import dill as pickle`. The source code is also generally well -documented, so further questions may be resolved by inspecting the code -itself. Please also feel free to submit a ticket on github, or ask a -question on stackoverflow (@Mike McKerns). - -`dill` is an active research tool. There are a growing number of publications -and presentations that discuss real-world examples and new features of `dill` -in greater detail than presented in the user's guide. If you would like to -share how you use `dill` in your work, please post a link or send an email -(to mmckerns at uqfoundation dot org). - - -Citation -======== - -If you use `dill` to do research that leads to publication, we ask that you -acknowledge use of `dill` by citing the following in your publication:: - - M.M. McKerns, L. Strand, T. Sullivan, A. Fang, M.A.G. Aivazis, - "Building a framework for predictive science", Proceedings of - the 10th Python in Science Conference, 2011; - http://arxiv.org/pdf/1202.1056 - - Michael McKerns and Michael Aivazis, - "pathos: a framework for heterogeneous computing", 2010- ; - http://trac.mystic.cacr.caltech.edu/project/pathos - -Please see http://trac.mystic.cacr.caltech.edu/project/pathos or -http://arxiv.org/pdf/1202.1056 for further information. - -""" % {'relver' : stable_version, 'thisver' : this_version} - -# write readme file -with open('README', 'w') as file: - file.write(long_description) - -# generate 'info' file contents -def write_info_py(filename='dill/info.py'): - contents = """# THIS FILE GENERATED FROM SETUP.PY -this_version = '%(this_version)s' -stable_version = '%(stable_version)s' -readme = '''%(long_description)s''' -license = '''%(license_text)s''' -""" - with open(filename, 'w') as file: - file.write(contents % {'this_version' : this_version, - 'stable_version' : stable_version, - 'long_description' : long_description, - 'license_text' : license_text }) - return - -# write info file -write_info_py() +with open(path.join(_here, 'README.rst')) as f: + long_description = f.read() # build the 'setup' call -setup_code = """ -setup(name='dill', - version='%s', - description='serialize all of python', - long_description = '''%s''', - author = 'Mike McKerns', - author_email = 'mmckerns at uqfoundation dot org', - maintainer = 'Mike McKerns', - maintainer_email = 'mmckerns at uqfoundation dot org', - license = '3-clause BSD', - platforms = ['Linux', 'Windows', 'Mac'], - url = 'http://www.cacr.caltech.edu/~mmckerns/dill.htm', - download_url = 'http://dev.danse.us/packages', - classifiers = ('Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: BSD License', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 3', - 'Topic :: Scientific/Engineering', - 'Topic :: Software Development'), - - packages = ['dill'], - package_dir = {'dill':'dill'}, -""" % (target_version, long_description) - -# add dependencies -ctypes_version = '>=1.0.1' -objgraph_version = '>=1.7.2' -pyreadline_version = '>=1.7.1' -import sys -if has_setuptools: - setup_code += """ - zip_safe=False, -""" - if sys.platform[:3] == 'win': - setup_code += """ - install_requires = ['pyreadline%s'], -""" % (pyreadline_version) - # verrrry unlikely that this is still relevant - elif hex(sys.hexversion) < '0x20500f0': - setup_code += """ - install_requires = ['ctypes%s'], -""" % (ctypes_version) - -# add the scripts, and close 'setup' call -setup_code += """ - scripts=['scripts/unpickle.py','scripts/get_objgraph.py']) -""" - -# exec the 'setup' code -exec(setup_code) - -# if dependencies are missing, print a warning -try: - import ctypes - import readline -except ImportError: - print ("\n***********************************************************") - print ("WARNING: One of the following dependencies is unresolved:") - print (" ctypes %s" % ctypes_version) - if sys.platform[:3] == 'win': - print (" readline %s" % pyreadline_version) - print ("***********************************************************\n") - - -if __name__=='__main__': - pass - -# end of file +setup( + name='dill', + use_scm_version={ + 'version_scheme': 'guess-next-dev', + 'local_scheme': 'dirty-tag', + 'write_to': 'dill/_version.py' + }, + description='serialize all of python', + long_description = long_description, + author_email = 'mmckerns at uqfoundation dot org', + maintainer = 'Mike McKerns', + maintainer_email = 'mmckerns at uqfoundation dot org', + license = '3-clause BSD', + url = 'http://trac.mystic.cacr.caltech.edu/project/pathos/wiki/dill.html', + classifiers = ( + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: BSD License', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', + 'Topic :: Scientific/Engineering', + 'Topic :: Software Development' + ), + + packages=find_packages(), + include_package_data=True, + package_data={'': ['LICENSE', '*.rst']}, + zip_safe=False, + install_requires=[], + setup_requires=['setuptools-scm>=1.6.0'], + extras_require={ + 'optional': [ + 'objgraph>=1.7.2', + 'numpy>=1.6' + ], + ":sys_platform=='win32'": "pyreadline>=1.7.1", + }, + entry_points={ + 'console_scripts': [ + 'get_objgraph = dill.get_objgraph:main', + 'unpickle = dill.unpickle:main', + ], + }, +)