summaryrefslogtreecommitdiff
path: root/media-sound/beets/files/1.4.9-0004-Fix-3608-Replace-discogs-client-with-python3-discogs.patch
blob: f7eb3d26b7585fa1ffea40ec4bdb1f3bb90cb8ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
From 0da62a5ed7aa5fcfc8501a06f26c3af6afa8bc52 Mon Sep 17 00:00:00 2001
From: George Rawlinson <george@rawlinson.net.nz>
Date: Thu, 25 Feb 2021 20:00:34 +1300
Subject: [PATCH] Fix #3608: Replace discogs-client with python3-discogs-client

discogs-client has been deprecated since June 2020, the replacement
is actively developed by the community and does not have any breaking
API changes.

Signed-off-by: George Rawlinson <george@rawlinson.net.nz>
---
 beetsplug/discogs.py     |  2 +-
 docs/plugins/discogs.rst |  8 +++----
 setup.py                 | 50 +++++++++++++++++++++++++++-------------
 4 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py
index 5a2bf57e..78d94eb1 100644
--- a/beetsplug/discogs.py
+++ b/beetsplug/discogs.py
@@ -14,7 +14,7 @@
 # included in all copies or substantial portions of the Software.
 
 """Adds Discogs album search support to the autotagger. Requires the
-discogs-client library.
+python3-discogs-client library.
 """
 from __future__ import division, absolute_import, print_function
 
 For plugin developers:
 
diff --git a/docs/plugins/discogs.rst b/docs/plugins/discogs.rst
index a02b3459..f8406fd2 100644
--- a/docs/plugins/discogs.rst
+++ b/docs/plugins/discogs.rst
@@ -10,9 +10,9 @@ Installation
 ------------
 
 To use the ``discogs`` plugin, first enable it in your configuration (see
-:ref:`using-plugins`). Then, install the `discogs-client`_ library by typing::
+:ref:`using-plugins`). Then, install the `python3-discogs-client`_ library by typing::
 
-    pip install discogs-client
+    pip install python3-discogs-client
 
 You will also need to register for a `Discogs`_ account, and provide
 authentication credentials via a personal access token or an OAuth2
@@ -36,7 +36,7 @@ Authentication via Personal Access Token
 
 As an alternative to OAuth, you can get a token from Discogs and add it to
 your configuration.
-To get a personal access token (called a "user token" in the `discogs-client`_
+To get a personal access token (called a "user token" in the `python3-discogs-client`_
 documentation), login to `Discogs`_, and visit the
 `Developer settings page
 <https://www.discogs.com/settings/developers>`_. Press the ``Generate new
@@ -57,4 +57,4 @@ Here are two things you can try:
 * Make sure that your system clock is accurate. The Discogs servers can reject
   your request if your clock is too out of sync.
 
-.. _discogs-client: https://github.com/discogs/discogs_client
+.. _python3-discogs-client: https://github.com/joalla/discogs_client
diff --git a/setup.py b/setup.py
index 79278f8b..768c40a0 100755
--- a/setup.py
+++ b/setup.py
@@ -107,30 +107,48 @@ setup(
         ['colorama'] if (sys.platform == 'win32') else []
     ),
 
-    tests_require=[
-        'beautifulsoup4',
-        'flask',
-        'mock',
-        'pylast',
-        'rarfile',
-        'responses',
-        'pyxdg',
-        'python-mpd2',
-        'discogs-client'
-    ] + (
-        # Tests for the thumbnails plugin need pathlib on Python 2 too.
-        ['pathlib'] if (sys.version_info < (3, 4, 0)) else []
-    ),
-
     # Plugin (optional) dependencies:
     extras_require={
+        'test': [
+            'beautifulsoup4',
+            'coverage',
+            'flask',
+            'mock',
+            'pylast',
+            'pytest',
+            'python-mpd2',
+            'pyxdg',
+            'responses>=0.3.0',
+            'requests_oauthlib',
+            'reflink',
+        ] + (
+            # Tests for the thumbnails plugin need pathlib on Python 2 too.
+            ['pathlib'] if (sys.version_info < (3, 4, 0)) else []
+        ) + [
+            'rarfile<4' if sys.version_info < (3, 6, 0) else 'rarfile',
+        ] + [
+            'discogs-client' if (sys.version_info < (3, 0, 0))
+            else 'python3-discogs-client'
+        ],
+        'lint': [
+            'flake8',
+            'flake8-coding',
+            'flake8-docstrings',
+            'flake8-future-import',
+            'pep8-naming',
+        ],
+
+        # Plugin (optional) dependencies:
         'absubmit': ['requests'],
         'fetchart': ['requests', 'Pillow'],
         'embedart': ['Pillow'],
         'embyupdate': ['requests'],
         'chroma': ['pyacoustid'],
         'gmusic': ['gmusicapi'],
-        'discogs': ['discogs-client>=2.2.1'],
+        'discogs': (
+            ['discogs-client' if (sys.version_info < (3, 0, 0))
+                else 'python3-discogs-client']
+        ),
         'beatport': ['requests-oauthlib>=0.6.1'],
         'kodiupdate': ['requests'],
         'lastgenre': ['pylast'],
-- 
2.26.3