14
0
forked from pool/python-minidb

Accepting request 915483 from home:glaubitz:branches:devel:languages:python

- Update to 2.0.5
  * Clean up things and set up CI (#16)
  * Don't use ported_eq function
- Drop patches for issues fixed upstream
  * no_ported_eq.patch
- Rename README to README.md in %files section

OBS-URL: https://build.opensuse.org/request/show/915483
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-minidb?expand=0&rev=11
This commit is contained in:
2021-09-01 18:45:31 +00:00
committed by Git OBS Bridge
parent 696bc72827
commit fc3785288f
5 changed files with 15 additions and 114 deletions

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c1c62be076a1e4bb9dd880504dd81a3e7e027b7657e8a54a83c5a2727f09520a
size 14104

3
minidb-2.0.5.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce14281cea2595ad0a805a5e4e9d2542ed0c10babb5d3d39ef63c40a286c717d
size 16799

View File

@@ -1,106 +0,0 @@
From ac709c48385583a0309ff850cd31896d5f19f647 Mon Sep 17 00:00:00 2001
From: Paolo Stivanin <info@paolostivanin.com>
Date: Fri, 27 Mar 2020 14:47:48 +0100
Subject: [PATCH] switch to pytest
---
test/test_minidb.py | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
--- a/test/test_minidb.py
+++ b/test/test_minidb.py
@@ -3,11 +3,6 @@ import pytest
import datetime
-def ported_eq(a, b, msg=None):
- if not a == b:
- raise AssertionError(msg or "%r != %r" % (a, b))
-
-
class FieldTest(minidb.Model):
CONSTANT = 123
@@ -195,7 +190,7 @@ def test_json_field_query():
db.register(WithJsonField)
d = {'a': [1, True, 3.9]}
WithJsonField(bar=d).save(db)
- ported_eq(next(WithJsonField.c.bar.query(db)).bar, d)
+ assert next(WithJsonField.c.bar.query(db)).bar == d
def test_json_field_renamed_query():
@@ -206,7 +201,7 @@ def test_json_field_renamed_query():
db.register(WithJsonField)
d = {'a': [1, True, 3.9]}
WithJsonField(bar=d).save(db)
- ported_eq(next(WithJsonField.c.bar('renamed').query(db)).renamed, d)
+ assert next(WithJsonField.c.bar('renamed').query(db)).renamed == d
def test_field_conversion_get_object():
@@ -477,11 +472,11 @@ def test_distinct():
# minidb.func.distinct(COLUMN)(NAME)
result = {tuple(x) for x in Foo.query(db, lambda c: minidb.func.distinct(c.bar)('foo'))}
- ported_eq(result, expected)
+ assert result == expected
# COLUMN.distinct(NAME)
result = {tuple(x) for x in Foo.query(db, Foo.c.bar.distinct('foo'))}
- ported_eq(result, expected)
+ assert result == expected
@@ -504,12 +499,12 @@ def test_group_by_with_sum():
# minidb.func.sum(COLUMN)(NAME)
result = {tuple(x) for x in Foo.query(db, lambda c: c.bar //
minidb.func.sum(c.baz)('sum'), group_by=lambda c: c.bar)}
- ported_eq(result, expected)
+ assert result == expected
# COLUMN.sum(NAME)
result = {tuple(x) for x in Foo.query(db, lambda c: c.bar //
c.baz.sum('sum'), group_by=lambda c: c.bar)}
- ported_eq(result, expected)
+ assert result == expected
def test_save_without_db_raises_valueerror():
@@ -552,10 +547,10 @@ def test_default_values_are_set_if_none(
with minidb.Store(debug=True) as db:
f = Foo()
- ported_eq(f.name, 'Bob')
+ assert f.name == 'Bob'
f = Foo(name='John')
- ported_eq(f.name, 'John')
+ assert f.name == 'John'
def test_default_values_with_callable():
@@ -572,16 +567,16 @@ def test_default_values_with_callable():
with minidb.Store(debug=True) as db:
f = Foo()
- ported_eq(f.name, 'Bob')
- ported_eq(f.email, 'Bob@example.com')
+ assert f.name == 'Bob'
+ assert f.email == 'Bob@example.com'
f = Foo(name='John')
- ported_eq(f.name, 'John')
- ported_eq(f.email, 'John@example.com')
+ assert f.name == 'John'
+ assert f.email == 'John@example.com'
f = Foo(name='Joe', email='joe@example.net')
- ported_eq(f.name, 'Joe')
- ported_eq(f.email, 'joe@example.net')
+ assert f.name == 'Joe'
+ assert f.email == 'joe@example.net'
def test_storing_and_retrieving_datetime():

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Sep 1 12:57:53 UTC 2021 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 2.0.5
* Clean up things and set up CI (#16)
* Don't use ported_eq function
- Drop patches for issues fixed upstream
* no_ported_eq.patch
- Rename README to README.md in %files section
-------------------------------------------------------------------
Tue Mar 16 15:59:42 UTC 2021 - Matej Cepl <mcepl@suse.com>

View File

@@ -20,16 +20,13 @@
%define skip_python2 1
%bcond_without test
Name: python-minidb
Version: 2.0.4
Version: 2.0.5
Release: 0
Summary: SQLite3-based store for Python objects
License: ISC
Group: Development/Languages/Python
URL: https://thp.io/2010/minidb/
Source: https://files.pythonhosted.org/packages/source/m/minidb/minidb-%{version}.tar.gz
# PATCH-FIX-UPSTREAM no_ported_eq.patch gh#thp/minidb#15 mcepl@suse.com
# Don't use ported_eq workaround.
Patch0: no_ported_eq.patch
BuildRequires: %{python_module setuptools}
BuildRequires: %{pythons}
BuildRequires: fdupes
@@ -60,7 +57,7 @@ Minidb 2 allows you to store Python objects in a SQLite 3 database.
%endif
%files %{python_files}
%doc README
%doc README.md
%{python_sitelib}/minidb.py*
%{python_sitelib}/minidb-%{version}-py*.egg-info
%pycache_only %{python_sitelib}/__pycache__/minidb*.py*