14
0
forked from pool/python-dill

Accepting request 603471 from devel:languages:python:misc

More flexible saving of python objects

OBS-URL: https://build.opensuse.org/request/show/603471
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dill?expand=0&rev=1
This commit is contained in:
Todd R
2018-05-03 06:07:24 +00:00
committed by Git OBS Bridge
commit 753e6de726
5 changed files with 146 additions and 0 deletions

107
python-dill.spec Normal file
View File

@@ -0,0 +1,107 @@
#
# spec file for package python-dill
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without test
Name: python-dill
Version: 0.2.7.1
Release: 0
Summary: Serialize all of python
License: BSD-3-Clause
Group: Development/Languages/Python
Url: http://www.cacr.caltech.edu/~mmckerns/dill.htm
Source: https://files.pythonhosted.org/packages/source/d/dill/dill-%{version}.tar.gz
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with test}
BuildRequires: %{python_module objgraph}
%endif
Recommends: python-objgraph
BuildArch: noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
%python_subpackages
%description
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 functions 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.
%prep
%setup -q -n dill-%{version}
find dill -name '*.py' -exec sed -i '1{\@^#!/usr/bin/env python@d}' {} \;
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
mv %{buildroot}%{_bindir}/dill_unpickle.py %{buildroot}%{_bindir}/dill_unpickle
mv %{buildroot}%{_bindir}/get_objgraph.py %{buildroot}%{_bindir}/get_objgraph
%python_clone -a %{buildroot}%{_bindir}/dill_unpickle
%python_clone -a %{buildroot}%{_bindir}/get_objgraph
%if %{with test}
%check
%python_exec tests/*.py
%endif
%post
%{python_install_alternative dill_unpickle get_objgraph}
%postun
%python_uninstall_alternative dill_unpickle
%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README README.md
%python_alternative %{_bindir}/dill_unpickle
%python_alternative %{_bindir}/get_objgraph
%{python_sitelib}/*
%changelog