]> git.draconx.ca Git - gentoo-fixes.git/commitdiff
dev-python/python-musicbrainz-ngs: Fix examples installation.
authorNick Bowler <nbowler@draconx.ca>
Sun, 26 Jan 2020 17:39:15 +0000 (12:39 -0500)
committerNick Bowler <nbowler@draconx.ca>
Mon, 27 Jan 2020 03:59:42 +0000 (22:59 -0500)
dev-python/python-musicbrainz-ngs/Manifest [new file with mode: 0644]
dev-python/python-musicbrainz-ngs/files/python-musicbrainz-ngs-0.6-fix-test-submit.patch [new file with mode: 0644]
dev-python/python-musicbrainz-ngs/python-musicbrainz-ngs-0.6.ebuild [new file with mode: 0644]

diff --git a/dev-python/python-musicbrainz-ngs/Manifest b/dev-python/python-musicbrainz-ngs/Manifest
new file mode 100644 (file)
index 0000000..d0c7e25
--- /dev/null
@@ -0,0 +1,3 @@
+AUX python-musicbrainz-ngs-0.6-fix-test-submit.patch 993 BLAKE2B 3347bd841f0f1b23477f387275ad8e6d40fcffc434150e93c0d57c9291c239639018c28e519032ee2cb251371343d0f3ce6c070b960d4ca8bd1dc5b5b480511f SHA512 ed5b6b674edddcc1d6047bfd97ffdbc1bd4ae3b83e61100b0389cabad84014dce894857faf5555824f245eacaea7541ee18424f630881698b8f2bebceabf8b78
+DIST python-musicbrainzngs-0.6.tar.gz 110948 BLAKE2B 9528d966565f7c927a98d311dcbb6db73a84614efa3eb071fe944b29b655526f9dd6e8a4a217428883d30b93c18e45c3d752d321d3c0689e5af00423b5fd7faa SHA512 901729f736b207f2f086e3d44a3515d405f6621706ad9c7ca07dd304349e048c5790bb16b054393651808bac4905ceb9493dd66d9fb17a1612692427c0bd3bd4
+EBUILD python-musicbrainz-ngs-0.6.ebuild 1556 BLAKE2B 6061a0f7e82a645955c422199a19eb298f680b502d305bf628f1a1885bafb60f91264bad96d69cf1099c56ea253f87775c88cee7fc5e6673eb958de17426ed1d SHA512 aaea28dedc01871f2c7ba6efcd00fe2f58159d1738602bf10f8fe61618e1f6432f2fd80dc290ca29959dd87c2c86e3da4d30863997e0a096792955f058abaa54
diff --git a/dev-python/python-musicbrainz-ngs/files/python-musicbrainz-ngs-0.6-fix-test-submit.patch b/dev-python/python-musicbrainz-ngs/files/python-musicbrainz-ngs-0.6-fix-test-submit.patch
new file mode 100644 (file)
index 0000000..4881936
--- /dev/null
@@ -0,0 +1,32 @@
+diff --git a/test/test_submit.py b/test/test_submit.py
+index bce5362..2d13811 100644
+--- a/test/test_submit.py
++++ b/test/test_submit.py
+@@ -1,13 +1,23 @@
+ import unittest
+-import os
+-import sys
+-sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
+-
+ import musicbrainzngs
+ from musicbrainzngs import musicbrainz
+ from test import _common
++
+ class SubmitTest(unittest.TestCase):
++
++    def setUp(self):
++        self.orig_opener = musicbrainzngs.compat.build_opener
++        musicbrainz.set_useragent("test_client", "1.0")
++        musicbrainz.auth("user", "password")
++
++    def tearDown(self):
++        musicbrainzngs.compat.build_opener = self.orig_opener
++        musicbrainz._useragent = ""
++        musicbrainz._client = ""
++        musicbrainz.user = ""
++        musicbrainz.password = ""
++
+     def test_submit_tags(self):
+         self.opener = _common.FakeOpener("<response/>")
+         musicbrainzngs.compat.build_opener = lambda *args: self.opener
diff --git a/dev-python/python-musicbrainz-ngs/python-musicbrainz-ngs-0.6.ebuild b/dev-python/python-musicbrainz-ngs/python-musicbrainz-ngs-0.6.ebuild
new file mode 100644 (file)
index 0000000..f9a26cd
--- /dev/null
@@ -0,0 +1,61 @@
+# Copyright © 2020 Nick Bowler
+# License GPLv2+: GNU General Public License version 2 or any later version.
+# This is free software: you are free to change and redistribute it.
+# There is NO WARRANTY, to the extent permitted by law.
+#
+# This is a modified version of the original ebuild from Gentoo GNU/Linux,
+# covered by the following copyright and permission notice:
+#
+#   Copyright 2019-2020 Gentoo Authors
+#   Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{6,7} )
+
+inherit distutils-r1
+
+MY_PN=${PN%-ngs}ngs
+MY_P=$MY_PN-$PV
+
+DESCRIPTION="Python bindings for the MusicBrainz NGS and the Cover Art Archive webservices"
+HOMEPAGE="https://github.com/alastair/python-musicbrainzngs"
+SRC_URI="https://github.com/alastair/$MY_PN/archive/v$PV.tar.gz -> $MY_P.tar.gz"
+
+LICENSE="BSD-2 ISC"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="doc examples test"
+RESTRICT="!test? ( test )"
+
+S=$WORKDIR/$MY_P
+
+PATCHES="$FILESDIR/$PN-0.6-fix-test-submit.patch"
+
+DEPEND="dev-python/setuptools[$PYTHON_USEDEP]
+       doc? ( dev-python/sphinx[$PYTHON_USEDEP] )"
+
+python_prepare_all() {
+       # Prevent un-needed d'loading
+       sed -e "s/^ *'sphinx.ext.intersphinx'//" -i docs/conf.py || die
+       distutils-r1_python_prepare_all
+}
+
+python_compile_all() {
+       use doc && emake -C docs html
+}
+
+python_test() {
+       esetup.py test --verbosity=2
+}
+
+python_install_all() {
+       use doc && local HTML_DOCS=( docs/_build/html/. )
+
+       if use examples; then
+               dodoc -r examples
+               docompress -x "/usr/share/doc/$PF/examples"
+       fi
+
+       distutils-r1_python_install_all
+}