From 182f31adcded9e06bc42263b9aaa8f9d75b5008ff814dc6c385f1cf776b7256a Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 5 Nov 2025 00:31:46 +0000 Subject: [PATCH] - Refresh patch python-sure-no-mock.patch: * Actually drop the requirement from setup.py - Add patch support-python314.patch: * Support Python 3.14 ast changes. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sure?expand=0&rev=35 --- .gitattributes | 23 ++++++ .gitignore | 1 + python-sure-no-mock.patch | 50 ++++++++++++ python-sure.changes | 155 ++++++++++++++++++++++++++++++++++++++ python-sure.spec | 92 ++++++++++++++++++++++ support-python314.patch | 13 ++++ sure-2.0.1.tar.gz | 3 + 7 files changed, 337 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-sure-no-mock.patch create mode 100644 python-sure.changes create mode 100644 python-sure.spec create mode 100644 support-python314.patch create mode 100644 sure-2.0.1.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-sure-no-mock.patch b/python-sure-no-mock.patch new file mode 100644 index 0000000..80f3506 --- /dev/null +++ b/python-sure-no-mock.patch @@ -0,0 +1,50 @@ +Index: sure-2.0.1/sure/core.py +=================================================================== +--- sure-2.0.1.orig/sure/core.py ++++ sure-2.0.1/sure/core.py +@@ -21,7 +21,10 @@ import os + try: + from mock import _CallList + except ImportError: +- from mock.mock import _CallList ++ try: ++ from mock.mock import _CallList ++ except ImportError: ++ from unittest.mock import _CallList + + import inspect + from six import ( +@@ -40,6 +43,7 @@ class Anything(object): + def __eq__(self, _): + return True + ++ + anything = Anything() + + +Index: sure-2.0.1/tests/test_assertion_builder.py +=================================================================== +--- sure-2.0.1.orig/tests/test_assertion_builder.py ++++ sure-2.0.1/tests/test_assertion_builder.py +@@ -17,7 +17,7 @@ + # along with this program. If not, see . + from __future__ import unicode_literals + import re +-import mock ++from unittest import mock + from collections import OrderedDict + + from datetime import datetime, timedelta +Index: sure-2.0.1/setup.py +=================================================================== +--- sure-2.0.1.orig/setup.py ++++ sure-2.0.1/setup.py +@@ -81,7 +81,7 @@ def read_readme(): + return __doc__ + + +-install_requires = ["mock", "six"] ++install_requires = ["six"] + tests_require = ["nose"] + version = read_version() + diff --git a/python-sure.changes b/python-sure.changes new file mode 100644 index 0000000..015daad --- /dev/null +++ b/python-sure.changes @@ -0,0 +1,155 @@ +------------------------------------------------------------------- +Wed Nov 5 00:30:51 UTC 2025 - Steve Kowalik + +- Refresh patch python-sure-no-mock.patch: + * Actually drop the requirement from setup.py +- Add patch support-python314.patch: + * Support Python 3.14 ast changes. + +------------------------------------------------------------------- +Mon Aug 25 14:05:31 UTC 2025 - Markéta Machová + +- Convert to libalternatives on SLE-16-based and newer systems + +------------------------------------------------------------------- +Tue Mar 26 19:06:01 UTC 2024 - John Paul Adrian Glaubitz + +- Switch build system from setuptools to pyproject.toml + + Add python-pip and python-wheel to BuildRequires + + Replace %python_build with %pyproject_wheel + + Replace %python_install with %pyproject_install + +------------------------------------------------------------------- +Mon Dec 4 10:46:23 UTC 2023 - Dirk Müller + +- update to 2.0.1: + * Fixes CI build (Github Actions) + * Fixes broken tests + * Housekeeping: Licensing + * Disable nosetests for testing leaving only pytest as + supported test-runner for now + +------------------------------------------------------------------- +Tue Jun 13 08:40:27 UTC 2023 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Wed Jul 13 04:37:13 UTC 2022 - Steve Kowalik + +- Remove mock from BuildRequires. +- Rebase python-sure-no-mock.patch to remove one missed import. + +------------------------------------------------------------------- +Wed May 4 08:38:45 UTC 2022 - pgajdos@suse.com + +- do not require mock for build nor runtime +- added patches + fix https://github.com/gabrielfalcao/sure/pull/161 + + python-sure-no-mock.patch + +------------------------------------------------------------------- +Sun Dec 12 16:15:50 UTC 2021 - Ben Greiner + +- Update to 2.0.0 + * No longer patch the builtin dir() function, which fixes pytest + in some cases such as projects using gevent. + +------------------------------------------------------------------- +Fri Jun 12 07:59:31 UTC 2020 - pgajdos@suse.com + +- switch to pytest + +------------------------------------------------------------------- +Wed Aug 29 11:47:15 UTC 2018 - tchvatal@suse.com + +- Version update to 1.4.11: + * Reading the version dynamically was causing import errors that caused error when installing package. Refs #144 + +------------------------------------------------------------------- +Fri Feb 2 13:38:53 UTC 2018 - tchvatal@suse.com + +- Fix url for the project + +------------------------------------------------------------------- +Sat Nov 4 02:06:40 UTC 2017 - arun@gmx.de + +- update to version 1.4.7: + * Remove wrong parens for format call. Refs #139 + +------------------------------------------------------------------- +Mon May 22 16:52:16 UTC 2017 - toddrme2178@gmail.com + +- Implement single-spec version. +- Fix source URL. +- Update to version 1.4.6 + * Enormous number of changes. Please see full changelog here: + https://github.com/gabrielfalcao/sure/blob/v1.4.6/CHANGELOG.md + +------------------------------------------------------------------- +Wed Mar 9 11:16:30 UTC 2016 - dvaleev@suse.com + +- Update to 1.2.24 +- Fix #48. + Ready to fast forward, Python 3.4 support again + Fixed a grammar nit when two things are not equal + +- When two things are not equal to each other, they “differ from” each other. +- fix: #80 + AttributeError: 'module' object has no attribute '_CallList' + +- Fix python3 setup.py file read encoding issue. +- adding carpentry build +- fixing api + +- New feature: + .should.have.thrown() alias to should.throw + .should.have.raised() alias to should.throw + .should.have.returned_the_value alias ro should.return_value + +- make python 3 compatible again + The function objects in python 3 have no `func_code` member anymore. Use `__code__` instead. + The byte objects in python 3 have no `format` method. Use `encode` instead. + The representation of the strings and encoded strings are different in python 2 and python 3 thus use PY3 from six. + Remove unlucky example from README since python 3 returns a float and python 2 an int in this situation + Python 2 and 3 build is working again + +-Fix #48. + AssertionBuilder.__call__ wasn't pushing through the + _callable_args and _callable_kw attributes, so they + weren't percolated through the assertion chain. + +------------------------------------------------------------------- +Wed Apr 22 11:35:20 UTC 2015 - mcihar@suse.cz + +- Update to 1.2.10 + * No upstream changelog available +- Remove only shebang by sed +- Run testsuite directly from setup.py +- Remove not needed patches (runTestsOnly.patch, sure_hideDeps.patch) + +------------------------------------------------------------------- +Fri Feb 6 16:36:59 UTC 2015 - rjschwei@suse.com + +- Update to version 1.2.5 + * No upstream changelog available +- remove Remove-shebang-line.patch, replaced by sed expression +- add sure_hideDeps.patch, hides implicit Python dependencies +- add runTestsOnly.patch only run the tests with make test +- run the package tests as part of the package build + +------------------------------------------------------------------- +Tue Nov 19 12:14:54 UTC 2013 - mcihar@suse.cz + +- remove shebang from module sources + +------------------------------------------------------------------- +Tue Nov 19 08:35:50 UTC 2013 - mcihar@suse.cz + +- various rpmlint fixes + +------------------------------------------------------------------- +Thu Nov 7 10:55:37 UTC 2013 - mcihar@suse.cz + +- Initial packaging + diff --git a/python-sure.spec b/python-sure.spec new file mode 100644 index 0000000..278e686 --- /dev/null +++ b/python-sure.spec @@ -0,0 +1,92 @@ +# +# spec file for package python-sure +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# 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 https://bugs.opensuse.org/ +# + + +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif +%{?sle15_python_module_pythons} +Name: python-sure +Version: 2.0.1 +Release: 0 +Summary: Utility belt for automated testing in python for python +License: GPL-3.0-or-later +URL: https://github.com/gabrielfalcao/sure +Source: https://files.pythonhosted.org/packages/source/s/sure/sure-%{version}.tar.gz +# Based on https://github.com/gabrielfalcao/sure/pull/161 +Patch0: python-sure-no-mock.patch +# PATCH-FIX-OPENSUSE Support Python 3.14 ast changes +Patch1: support-python314.patch +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module six >= 1.10.0} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-six >= 1.10.0 +BuildArch: noarch +%if %{with libalternatives} +BuildRequires: alts +Requires: alts +%else +Requires(post): update-alternatives +Requires(postun): update-alternatives +%endif +%python_subpackages + +%description +A testing library for python with powerful and flexible assertions. Sure is +heavily inspired by should.js + +%prep +%autosetup -p1 -n sure-%{version} +sed -i '/^#!/d' sure/*.py +sed -i 's/--cov=sure//' setup.cfg + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/sure +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# requires nose +rm tests/test_old_api.py +%pytest + +%post +%python_install_alternative sure + +%postun +%python_uninstall_alternative sure + +%pre +%python_libalternatives_reset_alternative sure + +%files %{python_files} +%license COPYING +%doc README.rst +%python_alternative %{_bindir}/sure +%{python_sitelib}/sure +%{python_sitelib}/sure-%{version}.dist-info + +%changelog diff --git a/support-python314.patch b/support-python314.patch new file mode 100644 index 0000000..1635a89 --- /dev/null +++ b/support-python314.patch @@ -0,0 +1,13 @@ +Index: sure-2.0.1/setup.py +=================================================================== +--- sure-2.0.1.orig/setup.py ++++ sure-2.0.1/setup.py +@@ -50,7 +50,7 @@ class VersionFinder(ast.NodeVisitor): + def visit_Assign(self, node): + try: + if node.targets[0].id == self.VARIABLE_NAME: +- self.version = node.value.s ++ self.version = node.value.value + except Exception: + pass + diff --git a/sure-2.0.1.tar.gz b/sure-2.0.1.tar.gz new file mode 100644 index 0000000..3424ea9 --- /dev/null +++ b/sure-2.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8fc6fabc0e7f6984eeabb942540e45646e5bef0bb99fe59e02da634e4d4b9ca +size 48467