From b068f1ac9123ea3adf047ab86182fb4ac35ba7a3d8e6c170e46d117d7683e5e3 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 14 May 2024 02:09:14 +0000 Subject: [PATCH] - Switch to pyproject and autosetup macros. - Add patch support-pytest-8.patch: * Use new "setup_method" to support pytest >= 8. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-lexicon?expand=0&rev=14 --- python-lexicon.changes | 7 +++++++ python-lexicon.spec | 18 ++++++++++-------- support-pytest-8.patch | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 8 deletions(-) create mode 100644 support-pytest-8.patch diff --git a/python-lexicon.changes b/python-lexicon.changes index f572ac6..d6a63ca 100644 --- a/python-lexicon.changes +++ b/python-lexicon.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue May 14 02:07:51 UTC 2024 - Steve Kowalik + +- Switch to pyproject and autosetup macros. +- Add patch support-pytest-8.patch: + * Use new "setup_method" to support pytest >= 8. + ------------------------------------------------------------------- Fri Apr 21 12:27:52 UTC 2023 - Dirk Müller diff --git a/python-lexicon.spec b/python-lexicon.spec index 01d5b4c..5e09b37 100644 --- a/python-lexicon.spec +++ b/python-lexicon.spec @@ -1,7 +1,7 @@ # # spec file for package python-lexicon # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} %{?sle15_python_module_pythons} Name: python-lexicon Version: 2.0.1 @@ -25,11 +24,15 @@ Summary: Python dict subclass(es) with aliasing and attribute access License: BSD-2-Clause URL: https://github.com/bitprophet/lexicon Source: https://files.pythonhosted.org/packages/source/l/lexicon/lexicon-%{version}.tar.gz +# PATCH-FIX-UPSTREAM (sort of) Not in the sdist, but on GitHub Patch0: add-pytest-ini.patch +# PATCH-FIX-OPENSUSE Support pytest >= 8 +Patch1: support-pytest-8.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-six # Completely different pkg but same namespece in sitelib folder Conflicts: python-dns-lexicon BuildArch: noarch @@ -46,14 +49,13 @@ Lexicon is a collection of dict subclasses: * Lexicon, a subclass of both of the above which exhibits both sets of behavior %prep -%setup -q -n lexicon-%{version} -%autopatch -p1 +%autosetup -p1 -n lexicon-%{version} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check @@ -63,6 +65,6 @@ Lexicon is a collection of dict subclasses: %doc README.rst %license LICENSE %{python_sitelib}/lexicon -%{python_sitelib}/lexicon-%{version}*-info +%{python_sitelib}/lexicon-%{version}.dist-info %changelog diff --git a/support-pytest-8.patch b/support-pytest-8.patch new file mode 100644 index 0000000..5ae0bb0 --- /dev/null +++ b/support-pytest-8.patch @@ -0,0 +1,22 @@ +Index: lexicon-2.0.1/tests/alias_dict.py +=================================================================== +--- lexicon-2.0.1.orig/tests/alias_dict.py ++++ lexicon-2.0.1/tests/alias_dict.py +@@ -36,7 +36,7 @@ class AliasDict_: + ad.unalias("lol no") + + class aliases_of: +- def setup(self): ++ def setup_method(self): + self.ad = AliasDict() + + def returns_list_of_aliases_for_given_real_key(self): +@@ -162,7 +162,7 @@ class AliasDict_: + class aliases_are_not_real_keys: + "aliases are not real keys" + +- def setup(self): ++ def setup_method(self): + self.a = AliasDict({"key1": "val1", "key2": "val2"}) + self.a.alias("myalias", "key1") +