forked from pool/python-JsonWeb
Accepting request 519799 from devel:languages:python:singlespec-staging
- singlespec auto-conversion - initial commit OBS-URL: https://build.opensuse.org/request/show/519799 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-JsonWeb?expand=0&rev=3
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 24 13:42:06 UTC 2017 - jmatejek@suse.com
|
||||
|
||||
- singlespec auto-conversion
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Oct 28 17:34:29 UTC 2015 - mimi.vx@gmail.com
|
||||
|
||||
- initial commit
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-JsonWeb
|
||||
#
|
||||
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# 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
|
||||
@@ -16,54 +16,40 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-JsonWeb
|
||||
Version: 0.8.2
|
||||
Release: 0
|
||||
Summary: Quickly add json serialization and deserialization to your python classes
|
||||
Summary: Add JSON (de)serialization to your python objects
|
||||
License: BSD-3-Clause
|
||||
Group: Development/Languages/Python
|
||||
Url: http://www.jsonweb.info/
|
||||
Source: https://pypi.python.org/packages/source/J/JsonWeb/JsonWeb-%{version}.tar.gz
|
||||
BuildRequires: python-coverage
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: python-nose
|
||||
Source: https://files.pythonhosted.org/packages/source/J/JsonWeb/JsonWeb-%{version}.tar.gz
|
||||
BuildRequires: %{python_module coverage}
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module nose}
|
||||
BuildRequires: python-rpm-macros
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
JsonWeb
|
||||
========
|
||||
Add JSON (de)serialization to your python objects :
|
||||
|
||||
>>> from jsonweb import decode, encode
|
||||
>>> @encode.to_object()
|
||||
... @decode.from_object()
|
||||
... class User(object):
|
||||
... def __init__(self, nick, email):
|
||||
... self.nick = nick
|
||||
... self.email = email
|
||||
>>> json_str = encode.dumper(User("cool_user123", "cool_user123@example.com"))
|
||||
>>> print json_str
|
||||
{"nick": "cool_user123", "__type__": "User", "email": "cool_user123@example.com"}
|
||||
>>> user = decode.loader(json_str)
|
||||
>>> print user.nick
|
||||
cool_user123
|
||||
>>> print user
|
||||
<User object at 0x10145e390>
|
||||
Quickly add json serialization and deserialization
|
||||
to your python classes.
|
||||
|
||||
%prep
|
||||
%setup -q -n JsonWeb-%{version}
|
||||
|
||||
%build
|
||||
python setup.py build
|
||||
%python_build
|
||||
|
||||
%install
|
||||
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
|
||||
%python_install
|
||||
|
||||
%check
|
||||
nosetests
|
||||
%python_expand nosetests-%{$python_bin_suffix}
|
||||
|
||||
%files
|
||||
%files %{python_files}
|
||||
%defattr(-,root,root,-)
|
||||
%doc README.rst
|
||||
%{python_sitelib}/*
|
||||
|
||||
Reference in New Issue
Block a user