From 00cb188db51970426be7ba5162025725d76f0482 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Feb 08 2021 17:27:00 +0000 Subject: Enable testing with pytest and use the github tarball The change is due to the tests not being present at the pypi tarball. Also change from nose to pytest and use the stdlib mock libraby. Minor fix for the version information. --- diff --git a/.gitignore b/.gitignore index 9eb3600..4b6d098 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /python-memcached-1.54.tar.gz /python-memcached-1.58.tar.gz /python-memcached-1.59.tar.gz +/1.59.tar.gz diff --git a/python-memcached.spec b/python-memcached.spec index f0b9874..be4f3ab 100644 --- a/python-memcached.spec +++ b/python-memcached.spec @@ -1,19 +1,19 @@ Name: python-memcached Version: 1.59 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A Python memcached client library License: Python URL: https://github.com/linsomniac/python-memcached -Source0: https://files.pythonhosted.org/packages/source/p/%{name}/%{name}-%{version}.tar.gz +Source0: https://github.com/linsomniac/python-memcached/archive/%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-six -BuildRequires: python3-nose # Required for running test suite BuildRequires: %{_bindir}/memcached +BuildRequires: python3-pytest %global _description\ This software is a 100% Python interface to the memcached memory cache\ @@ -34,6 +34,13 @@ Summary: %summary %prep %autosetup -n %{name}-%{version} +# Fix version information +sed -i 's/1\.58/1\.59/' memcache.py + +# Use the standard library mock instead of the external one +sed -i -e 's/^import mock/from unittest import mock/' \ + tests/test_memcache.py + %build %py3_build @@ -47,7 +54,7 @@ Summary: %summary pidfile=$(mktemp) memcached -d -P $pidfile -%{__python3} -m nose +%pytest kill $(cat $pidfile) @@ -61,6 +68,9 @@ kill $(cat $pidfile) %changelog +* Mon Feb 08 2021 Charalampos Stratakis - 1.59-3 +- Enable testing with pytest and use the github tarball + * Wed Jan 27 2021 Fedora Release Engineering - 1.59-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 351309a..6f337c8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (python-memcached-1.59.tar.gz) = a25cbb9efb3babe85e1523bdabfe4644b93b3a6a7268787a3928f724f833ce0eea7d2ef676d1b7f894cdfe293129975b35cb46ec553c92810dbc18013bfabece +SHA512 (1.59.tar.gz) = d7ff45a329f2a9bf97fdc7c0268c2c67046c3501270fcf03578b955c2da35904d7bdecd4239924d390797ddff8f4cc69fc5743f4d4f663cdb9f2f8c7e8159512