Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-discogs-client for openSUSE:Leap:16.0 checked in at 2025-07-24 08:30:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:16.0/python-discogs-client (Old) and /work/SRC/openSUSE:Leap:16.0/.python-discogs-client.new.8875 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-discogs-client" Thu Jul 24 08:30:47 2025 rev:2 rq:1293686 version:2.8 Changes: -------- --- /work/SRC/openSUSE:Leap:16.0/python-discogs-client/python-discogs-client.changes 2025-04-25 15:21:29.683735819 +0200 +++ /work/SRC/openSUSE:Leap:16.0/.python-discogs-client.new.8875/python-discogs-client.changes 2025-07-24 08:30:50.465407564 +0200 @@ -1,0 +2,12 @@ +Sun Jul 13 13:39:26 UTC 2025 - Dirk Müller <dmuel...@suse.com> + +- update to 2.8: + * New collection folder methods `move_release` and + `uncategorize_release` allowing to change folder of + collection items + * Add Python 3.13 to GitHub Actions build workflow and removed + EOL Python 3.8 + * Refactor some outdated Python code style along the way in + https://github.com/joalla/discogs_client/pull/165 + +------------------------------------------------------------------- Old: ---- v2.7.1.tar.gz New: ---- v2.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-discogs-client.spec ++++++ --- /var/tmp/diff_new_pack.e1mvwe/_old 2025-07-24 08:30:50.745419205 +0200 +++ /var/tmp/diff_new_pack.e1mvwe/_new 2025-07-24 08:30:50.749419372 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-discogs-client # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # Copyright (c) 2015 LISA GmbH, Bingen, Germany. # # All modifications and additions to the file contributed by third parties @@ -18,7 +18,7 @@ Name: python-discogs-client -Version: 2.7.1 +Version: 2.8 Release: 0 Summary: Python API client for Discogs License: BSD-2-Clause ++++++ v2.7.1.tar.gz -> v2.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discogs_client-2.7.1/.bumpversion.cfg new/discogs_client-2.8/.bumpversion.cfg --- old/discogs_client-2.7.1/.bumpversion.cfg 2024-11-14 08:05:37.000000000 +0100 +++ new/discogs_client-2.8/.bumpversion.cfg 2025-02-17 08:24:23.000000000 +0100 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.7.1 +current_version = 2.8 parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+))? serialize = {major}.{minor}.{patch} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discogs_client-2.7.1/.github/workflows/discogs_client-build.yml new/discogs_client-2.8/.github/workflows/discogs_client-build.yml --- old/discogs_client-2.7.1/.github/workflows/discogs_client-build.yml 2024-11-14 08:05:37.000000000 +0100 +++ new/discogs_client-2.8/.github/workflows/discogs_client-build.yml 2025-02-17 08:24:23.000000000 +0100 @@ -11,7 +11,7 @@ runs-on: ubuntu-20.04 strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discogs_client-2.7.1/discogs_client/__init__.py new/discogs_client-2.8/discogs_client/__init__.py --- old/discogs_client-2.7.1/discogs_client/__init__.py 2024-11-14 08:05:37.000000000 +0100 +++ new/discogs_client-2.8/discogs_client/__init__.py 2025-02-17 08:24:23.000000000 +0100 @@ -1,4 +1,4 @@ -__version__ = '2.7.1' +__version__ = '2.8' __version_info__ = tuple(int(i) for i in __version__.split('.') if i.isdigit()) from discogs_client.client import Client diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discogs_client-2.7.1/discogs_client/models.py new/discogs_client-2.8/discogs_client/models.py --- old/discogs_client-2.7.1/discogs_client/models.py 2024-11-14 08:05:37.000000000 +0100 +++ new/discogs_client-2.8/discogs_client/models.py 2025-02-17 08:24:23.000000000 +0100 @@ -745,7 +745,7 @@ count = SimpleField() #: def __init__(self, client, dict_): - super(CollectionFolder, self).__init__(client, dict_) + super().__init__(client, dict_) @property def releases(self): @@ -754,14 +754,34 @@ def add_release(self, release): release_id = release.id if isinstance(release, Release) else release - add_release_url = self.fetch('resource_url') + '/releases/{}'.format(release_id) - self.client._post(add_release_url, None) + resource_url = self.fetch('resource_url') + self.client._post(f"{resource_url}/releases/{release_id}", None) def remove_release(self, instance): + """Remove a collection item entirely. + """ if not isinstance(instance, CollectionItemInstance): raise TypeError('instance must be of type CollectionItemInstance') - instance_url = self.fetch('resource_url') + '/releases/{0}/instances/{1}'.format(instance.id, instance.instance_id) - self.client._delete(instance_url) + resource_url = self.fetch('resource_url') + self.client._delete(f"{resource_url}/releases/{instance.id}/instances/{instance.instance_id}") + + def move_release(self, instance, target_folder_id): + """Move a collection item to another folder. + + Moving to folder id 1 moves to the "Uncategorized" folder. + """ + if not isinstance(instance, CollectionItemInstance): + raise TypeError('instance must be of type CollectionItemInstance') + resource_url = self.fetch('resource_url') + self.client._post( + f"{resource_url}/releases/{instance.id}/instances/{instance.instance_id}", + {"folder_id": target_folder_id}, + ) + + def uncategorize_release(self, instance): + """Move a collection item to the "Uncategorized" folder. + """ + self.move_release(instance, 1) def __repr__(self): return '<CollectionFolder {0!r} {1!r}>'.format(self.id, self.name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discogs_client-2.7.1/discogs_client/tests/test_models.py new/discogs_client-2.8/discogs_client/tests/test_models.py --- old/discogs_client-2.7.1/discogs_client/tests/test_models.py 2024-11-14 08:05:37.000000000 +0100 +++ new/discogs_client-2.8/discogs_client/tests/test_models.py 2025-02-17 08:24:23.000000000 +0100 @@ -1,5 +1,5 @@ import unittest -from discogs_client.models import Artist, Release, ListItem, CollectionValue +from discogs_client.models import Artist, Release, ListItem, CollectionValue, CollectionItemInstance from discogs_client.tests import DiscogsClientTestCase from discogs_client.exceptions import HTTPError @@ -265,7 +265,6 @@ self.assertEqual(method, 'GET') self.assertEqual(url, '/marketplace/listings/150899904') - def test_collection(self): """Collection folders can be manipulated""" # Fetch the users collection folders from the filesystem @@ -314,6 +313,41 @@ self.assertEqual(method, 'POST') self.assertEqual(url, '/users/example/collection/folders/1/releases/1') + def test_collection_move_release(self): + """Collection items can be moved to another folder""" + # Fetch the users collection folders from the filesystem + u = self.d.user("example") + self.assertEqual(u.collection_folders[2].id, 2) + + # Mock expected responses for move_release test using "MemoryFetcher" + self.m._fetcher.fetcher.responses = { + "/users/example/collection/folders": (b''' + {"folders": [ + {"resource_url": "/users/example/collection/folders/0", "id": 0, "name": "All"}, + {"resource_url": "/users/example/collection/folders/1", "id": 1, "name": "Uncategorized folder"}, + {"resource_url": "/users/example/collection/folders/2", "id": 2, "name": "Collection folder 2"} + ]} + ''', 200), + # Mock the response of the POST request to the instance resource URL + "/users/example/collection/folders/1/releases/123456/instances/123": (b"", 204), + } + + # Bind the user to the MemoryFetcher + u.client = self.m + + # Mock a collection item instance + instance = CollectionItemInstance( + client=u.client, + dict_={"id": 123456, "instance_id": 123} + ) + # Perform the move + u.collection_folders[1].move_release(instance, 2) + + # Verify + method, url, _, _ = self.m._fetcher.last_request + self.assertEqual(method, "POST") + self.assertEqual(url, "/users/example/collection/folders/1/releases/123456/instances/123") + def test_delete_object(self): """Can request DELETE on an APIObject""" u = self.d.user('example') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discogs_client-2.7.1/docs/source/conf.py new/discogs_client-2.8/docs/source/conf.py --- old/discogs_client-2.7.1/docs/source/conf.py 2024-11-14 08:05:37.000000000 +0100 +++ new/discogs_client-2.8/docs/source/conf.py 2025-02-17 08:24:23.000000000 +0100 @@ -22,7 +22,7 @@ author = 'The Joalla Team' # The full version, including alpha/beta/rc tags -release = '2.7.1' +release = '2.8' # -- General configuration --------------------------------------------------- @@ -80,7 +80,8 @@ # MyST extenstion configuration myst_heading_anchors = 7 myst_enable_extensions = [ - "substitution" + "substitution", + "colon_fence", ] myst_substitutions = { "class": "I'm a **substitution**" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discogs_client-2.7.1/docs/source/fetching_data.md new/discogs_client-2.8/docs/source/fetching_data.md --- old/discogs_client-2.7.1/docs/source/fetching_data.md 2024-11-14 08:05:37.000000000 +0100 +++ new/discogs_client-2.8/docs/source/fetching_data.md 2025-02-17 08:24:23.000000000 +0100 @@ -231,7 +231,7 @@ _{meth}`.add_release` also accepts {class}`.Release` objects_ -### Removing a Release from a Collection Folder +### Removing a Release from the Collection Removing a single release instance identified by its index: @@ -242,6 +242,10 @@ folder.remove_release(releases[0]) ``` +:::{caution} +The {meth}`.remove_release` method deletes from the collection entirely. To remove an instance from a folder only, use the {meth}`.uncategorize_release` method. +::: + To filter out which instance to remove we could also use the attributes of the {class}`.Release` object attached to the {class}`.CollectionItemInstance`: ```python @@ -251,16 +255,34 @@ folder.remove_release(instance) ``` -Another approach to removing instances from collection folders if we know a release ID already would be to make use of the {meth}`.collection_items` method. This way we could delete all the instances from all its containing folders: +### Removing a Release from a Folder + +To remove a release from a collection folder, we need to know the release ID already and make use of the {meth}`.collection_items` method. This way we could remove all the instances from all its containing folders (uncategorize them): ```python release_instances = me.collection_items(22155985) for instance in release_instances: folder = me.collection_folders[instance.folder_id] - folder.remove_release(instance) + folder.uncategorize_release(instance) +``` + +### Moving a Release to a Different Folder + +To move a release from a collection folder to another one, again we need to know the release ID already and make use of the {meth}`.collection_items` method. We also need to know the ID of the target folder we want to move to (use {attr}`.collection_folders`). We move all the instances from all its containing folders to a specified target folder: + +```python +release_instances = me.collection_items(22155985) +target_folder = 1 +for folder in me.collection_folders: + if folder.name == "My Target Folder": + target_folder = folder.id + +for instance in release_instances: + folder = me.collection_folders[instance.folder_id] + folder.move_release(instance, target_folder) ``` -_{meth}`.remove_release` only accepts {class}`.CollectionItemInstance` objects_ +_{meth}`.remove_release`, {meth}`.move_release` and {meth}`.uncategorize_release` only accept {class}`.CollectionItemInstance` objects_ ## Using {meth}`~discogs_client.models.PrimaryAPIObject.fetch` to get other data diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/discogs_client-2.7.1/setup.py new/discogs_client-2.8/setup.py --- old/discogs_client-2.7.1/setup.py 2024-11-14 08:05:37.000000000 +0100 +++ new/discogs_client-2.8/setup.py 2025-02-17 08:24:23.000000000 +0100 @@ -4,7 +4,7 @@ setup( name='python3-discogs-client', - version='2.7.1', + version='2.8', description='Python API client for Discogs', long_description='This is an active fork of the official "Discogs API client for Python", which was deprecated by discogs.com as of June 2020. We think it is a very useful Python module and decided to continue maintaining it. Please visit: https://github.com/joalla/discogs_client for more information.', url='https://github.com/joalla/discogs_client',