From 1d46b71e1d966458878dd67a685885bec89f7c83fb9e6728ed0eb5499edce686 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 6 Feb 2024 04:50:10 +0000 Subject: [PATCH] - Update to 0.19.1: * Fix "Table 'django_session' doesn't exist" error * Unify identities with same source * Use correct base URL for login and change password API calls (#851) * Display individual's most recent organization * CSRF token is only required on web requests * Link to profile in individual cards (#837) * Open calendar to the side of the date input (#838) * Improved loading time when looking for organizations * Gitdm identities importer * Fix individual page not loading * Recommendations for individuals modified after a given date (#813) * Add individual to workspace from their profile page (#816) * Cache individuals table data (#821) * Strict criteria for merge recommendations (#812) * Text field to update enrollment dates (#819) * Improved organization selector (#820) * API method to create a scheduled task * Manage app settings from the user interface * Remove tasks that fail to be scheduled * Add Python 3.9 and drop 3.7 support * Sub-domain affiliation error (#805) - Refresh patches. - Add patch use-correct-assertion-methods.patch: * Use non-deprecated and non-removed assertion methods. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sortinghat?expand=0&rev=40 --- add-missing-format-calls.patch | 38 +++++++++---------- allow-database-config-overrides.patch | 12 +++--- python-sortinghat.changes | 29 +++++++++++++++ python-sortinghat.spec | 12 ++++-- sortinghat-0.12.0.tar.gz | 3 -- sortinghat-0.19.1.tar.gz | 3 ++ use-correct-assertion-methods.patch | 53 +++++++++++++++++++++++++++ 7 files changed, 119 insertions(+), 31 deletions(-) delete mode 100644 sortinghat-0.12.0.tar.gz create mode 100644 sortinghat-0.19.1.tar.gz create mode 100644 use-correct-assertion-methods.patch diff --git a/add-missing-format-calls.patch b/add-missing-format-calls.patch index 573c415..04a253a 100644 --- a/add-missing-format-calls.patch +++ b/add-missing-format-calls.patch @@ -1,7 +1,7 @@ -Index: grimoirelab-sortinghat-0.12.0/tests/test_schema.py +Index: grimoirelab-sortinghat-0.19.1/tests/test_schema.py =================================================================== ---- grimoirelab-sortinghat-0.12.0.orig/tests/test_schema.py -+++ grimoirelab-sortinghat-0.12.0/tests/test_schema.py +--- grimoirelab-sortinghat-0.19.1.orig/tests/test_schema.py ++++ grimoirelab-sortinghat-0.19.1/tests/test_schema.py @@ -22,6 +22,7 @@ # @@ -18,7 +18,7 @@ Index: grimoirelab-sortinghat-0.12.0/tests/test_schema.py def test_page_size_negative(self): """Check if it fails when `pageSize` is a negative number""" -@@ -6343,7 +6345,8 @@ class TestAddIdentityMutation(django.tes +@@ -6367,7 +6369,8 @@ class TestAddIdentityMutation(django.tes variables=params) msg = executed['errors'][0]['message'] @@ -28,7 +28,7 @@ Index: grimoirelab-sortinghat-0.12.0/tests/test_schema.py def test_add_identity_name_none(self): """Check if the username is set to the profile when no name is provided""" -@@ -8139,7 +8142,8 @@ class TestWithdrawMutation(django.test.T +@@ -8163,7 +8166,8 @@ class TestWithdrawMutation(django.test.T variables=params) msg = executed['errors'][0]['message'] @@ -38,7 +38,7 @@ Index: grimoirelab-sortinghat-0.12.0/tests/test_schema.py def test_non_existing_organization(self): """Check if it fails when the organization does not exist""" -@@ -9771,6 +9775,7 @@ class TestUnifyMutation(django.test.Test +@@ -9850,6 +9854,7 @@ class TestUnifyMutation(django.test.Test source='scm', uuid=self.jrae.uuid) @@ -46,18 +46,18 @@ Index: grimoirelab-sortinghat-0.12.0/tests/test_schema.py @unittest.mock.patch('sortinghat.core.jobs.rq.job.uuid4') def test_unify(self, mock_job_id_gen): """Check if unify is applied for the specified individuals""" -@@ -9842,6 +9847,7 @@ class TestUnifyMutation(django.test.Test +@@ -9922,6 +9927,7 @@ class TestUnifyMutation(django.test.Test id5 = identities[4] self.assertEqual(id5, self.jr2) + @unittest.skip("Broken") @unittest.mock.patch('sortinghat.core.jobs.rq.job.uuid4') - def test_unify_exclude(self, mock_job_id_gen): - """Check if unify is applied for the specified individuals""" -Index: grimoirelab-sortinghat-0.12.0/tests/cli/test_cmd_config.py + def test_unify_last_modified(self, mock_job_id_gen): + """Check if unify is applied only for the individuals modified after a date""" +Index: grimoirelab-sortinghat-0.19.1/tests/cli/test_cmd_config.py =================================================================== ---- grimoirelab-sortinghat-0.12.0.orig/tests/cli/test_cmd_config.py -+++ grimoirelab-sortinghat-0.12.0/tests/cli/test_cmd_config.py +--- grimoirelab-sortinghat-0.19.1.orig/tests/cli/test_cmd_config.py ++++ grimoirelab-sortinghat-0.19.1/tests/cli/test_cmd_config.py @@ -41,10 +41,10 @@ MOCK_CONFIG_FILEPATH = os.path.join(os.p @@ -71,16 +71,16 @@ Index: grimoirelab-sortinghat-0.12.0/tests/cli/test_cmd_config.py class TestInitConfig(unittest.TestCase): -Index: grimoirelab-sortinghat-0.12.0/sortinghat/core/decorators.py +Index: grimoirelab-sortinghat-0.19.1/sortinghat/core/decorators.py =================================================================== ---- grimoirelab-sortinghat-0.12.0.orig/sortinghat/core/decorators.py -+++ grimoirelab-sortinghat-0.12.0/sortinghat/core/decorators.py -@@ -44,6 +44,8 @@ check_auth = user_passes_test( +--- grimoirelab-sortinghat-0.19.1.orig/sortinghat/core/decorators.py ++++ grimoirelab-sortinghat-0.19.1/sortinghat/core/decorators.py +@@ -68,6 +68,8 @@ check_auth = user_passes_test(lambda u: def check_permissions(perms): + if isinstance(perms, str): + perms = (perms,) - return user_passes_test( - lambda u: u.has_perms(perms) or not settings.SORTINGHAT_AUTHENTICATION_REQUIRED - ) + return user_passes_test(lambda u: u.has_perms(perms)) + + diff --git a/allow-database-config-overrides.patch b/allow-database-config-overrides.patch index 7f29a6f..82a90a0 100644 --- a/allow-database-config-overrides.patch +++ b/allow-database-config-overrides.patch @@ -1,7 +1,7 @@ -Index: grimoirelab-sortinghat-0.11.1/config/settings/testing.py +Index: grimoirelab-sortinghat-0.19.1/config/settings/testing.py =================================================================== ---- grimoirelab-sortinghat-0.11.1.orig/config/settings/testing.py -+++ grimoirelab-sortinghat-0.11.1/config/settings/testing.py +--- grimoirelab-sortinghat-0.19.1.orig/config/settings/testing.py ++++ grimoirelab-sortinghat-0.19.1/config/settings/testing.py @@ -1,3 +1,4 @@ +import os import sys @@ -30,10 +30,10 @@ Index: grimoirelab-sortinghat-0.11.1/config/settings/testing.py } } -Index: grimoirelab-sortinghat-0.11.1/config/settings/testing_tenant.py +Index: grimoirelab-sortinghat-0.19.1/config/settings/testing_tenant.py =================================================================== ---- grimoirelab-sortinghat-0.11.1.orig/config/settings/testing_tenant.py -+++ grimoirelab-sortinghat-0.11.1/config/settings/testing_tenant.py +--- grimoirelab-sortinghat-0.19.1.orig/config/settings/testing_tenant.py ++++ grimoirelab-sortinghat-0.19.1/config/settings/testing_tenant.py @@ -5,8 +5,8 @@ from .testing import SQL_MODE, DATABASES DATABASES.update({ tenant: { diff --git a/python-sortinghat.changes b/python-sortinghat.changes index 86fd306..0849f42 100644 --- a/python-sortinghat.changes +++ b/python-sortinghat.changes @@ -1,3 +1,32 @@ +------------------------------------------------------------------- +Tue Feb 6 04:49:48 UTC 2024 - Steve Kowalik + +- Update to 0.19.1: + * Fix "Table 'django_session' doesn't exist" error + * Unify identities with same source + * Use correct base URL for login and change password API calls (#851) + * Display individual's most recent organization + * CSRF token is only required on web requests + * Link to profile in individual cards (#837) + * Open calendar to the side of the date input (#838) + * Improved loading time when looking for organizations + * Gitdm identities importer + * Fix individual page not loading + * Recommendations for individuals modified after a given date (#813) + * Add individual to workspace from their profile page (#816) + * Cache individuals table data (#821) + * Strict criteria for merge recommendations (#812) + * Text field to update enrollment dates (#819) + * Improved organization selector (#820) + * API method to create a scheduled task + * Manage app settings from the user interface + * Remove tasks that fail to be scheduled + * Add Python 3.9 and drop 3.7 support + * Sub-domain affiliation error (#805) +- Refresh patches. +- Add patch use-correct-assertion-methods.patch: + * Use non-deprecated and non-removed assertion methods. + ------------------------------------------------------------------- Thu Jul 27 06:07:58 UTC 2023 - Steve Kowalik diff --git a/python-sortinghat.spec b/python-sortinghat.spec index 562159f..dd51592 100644 --- a/python-sortinghat.spec +++ b/python-sortinghat.spec @@ -1,7 +1,7 @@ # # spec file for package python-sortinghat # -# 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 @@ -17,7 +17,7 @@ Name: python-sortinghat -Version: 0.12.0 +Version: 0.19.1 Release: 0 Summary: A tool to manage identities License: GPL-3.0-only @@ -26,6 +26,9 @@ Source: https://github.com/chaoss/grimoirelab-sortinghat/archive/refs/ta # PATCH-FIX-OPENSUSE Allow overridding the database config Patch0: allow-database-config-overrides.patch Patch1: add-missing-format-calls.patch +# PATCH-FIX-UPSTREAM gh#chaoss/grimoirelab-sortinghat#855 +Patch2: use-correct-assertion-methods.patch +BuildRequires: %{python_module base >= 3.9} BuildRequires: %{python_module pip} BuildRequires: %{python_module poetry-core} BuildRequires: %{python_module wheel} @@ -45,14 +48,17 @@ Requires: python-django-treebeard >= 4.5 Requires: python-graphene >= 2.1.5 Requires: python-graphene-django Requires: python-grimoirelab-toolkit >= 0.3 +Requires: python-importlib-resources Requires: python-mysqlclient >= 2.0 +Requires: python-numpy Requires: python-pandas >= 1.3 Requires: python-python-dateutil >= 2.8.0 Requires: python-requests >= 2.7 Requires: python-rq +Requires: python-setuptools Requires: python-sgqlc Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module Jinja2 >= 3.1} diff --git a/sortinghat-0.12.0.tar.gz b/sortinghat-0.12.0.tar.gz deleted file mode 100644 index ef99bcd..0000000 --- a/sortinghat-0.12.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:738e425e3031a4eecf502110ac550103e67eb96f10982dac8fe832b04c1af7a5 -size 2420879 diff --git a/sortinghat-0.19.1.tar.gz b/sortinghat-0.19.1.tar.gz new file mode 100644 index 0000000..9bc1061 --- /dev/null +++ b/sortinghat-0.19.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20ec93c4c5951bfeb2cbd5f750209eaf1aa3ab57228676c98ebc00e2f92abc05 +size 2441873 diff --git a/use-correct-assertion-methods.patch b/use-correct-assertion-methods.patch new file mode 100644 index 0000000..28ab34f --- /dev/null +++ b/use-correct-assertion-methods.patch @@ -0,0 +1,53 @@ +From ad69dc80b8e8b4df49a3fe14e4a05ec31c7a67e8 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Tue, 6 Feb 2024 15:22:33 +1100 +Subject: [PATCH] Switch to self.assertRaisesRegex() + +assertRaisesRegexp() is a deprecated (and as of Python 3.12, removed) +alias of assertRaisesRegex(). Switch to it to avoid future problems. + +Signed-off-by: Steve Kowalik +--- + tests/test_aux.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tests/test_aux.py b/tests/test_aux.py +index 86e421422..91a1c29c3 100644 +--- a/tests/test_aux.py ++++ b/tests/test_aux.py +@@ -338,7 +338,7 @@ def test_dates_out_of_bounds(self): + + expected = DATE_OUT_OF_BOUNDS_ERROR.format(type='start', + date=r'1800-01-01 00:00:00\+00:00') +- with self.assertRaisesRegexp(ValueError, expected): ++ with self.assertRaisesRegex(ValueError, expected): + _ = [r for r in merge_datetime_ranges(dates)] + + # Case 2 +@@ -349,7 +349,7 @@ def test_dates_out_of_bounds(self): + + expected = DATE_OUT_OF_BOUNDS_ERROR.format(type='end', + date=r'2100-02-01 00:00:00\+00:00') +- with self.assertRaisesRegexp(ValueError, expected): ++ with self.assertRaisesRegex(ValueError, expected): + _ = [r for r in merge_datetime_ranges(dates)] + + def test_dates_no_timezone(self): +@@ -361,7 +361,7 @@ def test_dates_no_timezone(self): + (datetime.datetime(1800, 1, 1, tzinfo=UTC), datetime.datetime(2010, 1, 1, tzinfo=UTC)) + ] + +- with self.assertRaisesRegexp(TypeError, CANT_COMPARE_DATES_ERROR): ++ with self.assertRaisesRegex(TypeError, CANT_COMPARE_DATES_ERROR): + _ = [r for r in merge_datetime_ranges(dates)] + + # Case 2 +@@ -370,7 +370,7 @@ def test_dates_no_timezone(self): + (datetime.datetime(1900, 1, 1, tzinfo=UTC), datetime.datetime(2010, 1, 1)) + ] + +- with self.assertRaisesRegexp(TypeError, CANT_COMPARE_DATES_ERROR): ++ with self.assertRaisesRegex(TypeError, CANT_COMPARE_DATES_ERROR): + _ = [r for r in merge_datetime_ranges(dates)] + +