Diff beets-1.7.0_pre20240501-r1 with a beets-9999

/usr/portage/media-sound/beets/beets-9999.ebuild 2026-05-20 19:17:03.654246160 +0300
4 4
EAPI=8
5 5

  
6 6
DISTUTILS_SINGLE_IMPL=1
7
DISTUTILS_USE_PEP517=setuptools
8
PYTHON_COMPAT=( python3_12 )
7
DISTUTILS_USE_PEP517=poetry
8
PYTHON_COMPAT=( python3_{12..14} )
9 9
PYTHON_REQ_USE="sqlite"
10 10

  
11 11
# These envvars are used to treat github tarball builds differently
......
13 13
: ${IS_VCS_SOURCE="no"}
14 14
: ${UPDATE_VERSION="no"}
15 15

  
16
inherit distutils-r1 bash-completion-r1 multiprocessing optfeature
16
inherit distutils-r1 optfeature shell-completion
17 17

  
18 18
if [[ ${PV} == "9999" ]]; then
19 19
	EGIT_REPO_URI="https://github.com/beetbox/beets.git"
20
	inherit git-r3
21
else
22
	MY_COMMIT=c75f07a0da6c622d3cd0f5aad0a08edaea360dad
23
	# This should be set to 1 if we're not sourcing tarballs from pypi; we need to generate mans.
24 20
	IS_VCS_SOURCE="yes"
25 21
	UPDATE_VERSION="yes"
26
	SRC_URI="https://github.com/beetbox/beets/archive/${MY_COMMIT}.tar.gz -> ${P}.gh.tar.gz"
27
	KEYWORDS="amd64 ~x86"
28
	S="${WORKDIR}/${PN}-${MY_COMMIT}"
22
	inherit git-r3
23
else
24
	PYPI_VERIFY_REPO=https://github.com/beetbox/beets
25
	inherit pypi
26
	MY_PV=${PV/_beta/-beta.}
27
	MY_P=${PN}-${MY_PV}
28
	KEYWORDS="~amd64"
29
	S="${WORKDIR}/${MY_P}"
29 30
fi
30 31

  
31 32
DESCRIPTION="Media library management system for obsessive music geeks"
......
33 34

  
34 35
LICENSE="MIT"
35 36
SLOT="0"
36
IUSE="doc test"
37
RESTRICT="!test? ( test )"
37

  
38
# TODO: test-full with GITHUB_ACTIONS=true. Would require packaging more dependencies.
38 39

  
39 40
RDEPEND="
40 41
	$(python_gen_cond_dep '
41 42
		>=dev-python/jellyfish-0.7.1[${PYTHON_USEDEP}]
42
		dev-python/munkres[${PYTHON_USEDEP}]
43 43
		>=media-libs/mutagen-1.33[${PYTHON_USEDEP}]
44
		>=dev-python/musicbrainzngs-0.4[${PYTHON_USEDEP}]
44
		>=dev-python/confuse-2.2.0[${PYTHON_USEDEP}]
45
		>=dev-python/lap-0.5.12[${PYTHON_USEDEP}]
46
		>=dev-python/mediafile-0.16.2[${PYTHON_USEDEP}]
47
		>=dev-python/numpy-2[${PYTHON_USEDEP}]
48
		>=dev-python/packaging-24.0[${PYTHON_USEDEP}]
45 49
		dev-python/pyyaml[${PYTHON_USEDEP}]
46
		dev-python/confuse[${PYTHON_USEDEP}]
47
		dev-python/mediafile[${PYTHON_USEDEP}]
48 50
		dev-python/reflink[${PYTHON_USEDEP}]
49
		dev-python/requests-oauthlib[${PYTHON_USEDEP}]
50
		dev-python/requests[${PYTHON_USEDEP}]
51
		>=dev-python/requests-ratelimiter-0.7.0[${PYTHON_USEDEP}]
52
		>=dev-python/requests-2.32.5[${PYTHON_USEDEP}]
51 53
		dev-python/typing-extensions[${PYTHON_USEDEP}]
52
		dev-python/unidecode[${PYTHON_USEDEP}]
53
	')"
54
DEPEND="
55
	${RDEPEND}
54
		>=dev-python/unidecode-1.3.6[${PYTHON_USEDEP}]
55
	')
56 56
"
57 57
BDEPEND="
58
	doc? (
59
		dev-python/sphinx
60
		dev-python/pydata-sphinx-theme
61
	)
62 58
	$(python_gen_cond_dep '
63 59
		test? (
64 60
			dev-db/sqlite[icu]
65 61
			dev-python/beautifulsoup4[${PYTHON_USEDEP}]
66 62
			dev-python/bluelet[${PYTHON_USEDEP}]
63
			dev-python/dbus-python[${PYTHON_USEDEP}]
67 64
			dev-python/python3-discogs-client[${PYTHON_USEDEP}]
68 65
			dev-python/flask[${PYTHON_USEDEP}]
69 66
			dev-python/mock[${PYTHON_USEDEP}]
......
78 75
				media-gfx/imagemagick
79 76
			)
80 77
			dev-python/rarfile[${PYTHON_USEDEP}]
78
			dev-python/requests-mock[${PYTHON_USEDEP}]
81 79
			dev-python/responses[${PYTHON_USEDEP}]
82 80
			dev-python/wheel[${PYTHON_USEDEP}]
83 81
			media-libs/chromaprint[tools]
......
90 88
			media-video/ffmpeg[encode(+)]
91 89
			app-shells/bash-completion
92 90
		)
93
	')"
91
	')
92
"
94 93

  
95 94
# Beets uses sphinx to generate manpages; these are not available
96 95
# directly in VCS sources, only pypi tarballs, so handle the dependency
97 96
# here automagically.
98 97
if [[ ${PV} == "9999" ]] || [[ ${IS_VCS_SOURCE} == "yes" ]]; then
99
	BDEPEND+="
100
		dev-python/sphinx
101
	"
98
	BDEPEND+=" $(python_gen_cond_dep 'dev-python/sphinx[${PYTHON_USEDEP}]')"
102 99
fi
103 100

  
104 101
DOCS=( README.rst docs/changelog.rst )
105 102

  
103
EPYTEST_PLUGINS=( pytest-flask )
104
EPYTEST_IGNORE=(
105
	# Not relevant downstream
106
	test/test_release.py
107
	# Unpackaged test dependencies: titlecase and pytest-factoryboy
108
	# (These tests aren't included in the sdist)
109
	test/plugins
110
)
106 111
EPYTEST_XDIST=1
107 112
distutils_enable_tests pytest
108 113

  
109
src_prepare() {
110
	# https://github.com/beetbox/beets/commit/8b4983fe7cae9397acd3e23602e419d8dc1041d4
111
	# merged code coverage into standard test runs; since we disable coverage globally
112
	# we need to sed out some 'addopts' for coverage in setup.cfg that cause tests to choke.
113
	sed -i -e "/--cov=beets/,+9d" setup.cfg || die "Failed to disable code coverage options in setup.cfg"
114
	# Update the version if we're not building from pypy; it's probably a _pre or live ebuild.
114
python_prepare_all() {
115
	distutils-r1_python_prepare_all
116

  
115 117
	if  [[ ${PV} == "9999" ]] || [[ ${UPDATE_VERSION} == "yes" ]]; then
116
		    sed -i -e "s/version=\".*\"/version=\"${PV}\"/" setup.py || die "Failed to update version in VCS sources"
118
		sed -i -e "s/^version = \".*\"$/version = \"${PV}\"/" \
119
			pyproject.toml \
120
			|| die "Failed to update version in VCS sources"
117 121
			sed -i -e "s/__version__ = \".*\"/__version__ = \"${PV}\"/" beets/__init__.py
118 122
	fi
119
	default
120
}
121 123

  
122
python_prepare_all() {
123
	distutils-r1_python_prepare_all
124
	# Don't require extra unpackaged sphinx dependencies to generate man pages on live
125
	sed -e '/sphinx_design/d' \
126
		-e '/sphinx_copybutton/d' \
127
		-e '/sphinx_toolbox/d' \
128
		-i docs/conf.py || die
124 129
}
125 130

  
126 131
python_compile_all() {
127
	if use doc ; then
128
		sphinx-build -b html docs docs/build/html || die
129
	fi
130 132
	# If building from VCS sources we need to generate manpages, then copy them to ${S}/man
131 133
	# We could install mans from the sphinx build path, but to be consistent with pypi for src_install
132 134
	# we'll instead generate them and copy to the same install location if building from VCS sources.
......
138 140
	fi
139 141
}
140 142

  
141
python_test() {
142
	# https://github.com/beetbox/beets/issues/5243 testing bash completions is broken.
143
	local EPYTEST_DESELECT=(
144
		test/test_ui.py::CompletionTest::test_completion
145
	)
146
	epytest -n$(makeopts_jobs) -v
147
}
148

  
149 143
python_install_all() {
150 144
	distutils-r1_python_install_all
151 145

  
146
	# remove leftover file in sdist
147
	if [[ -e man/_sphinx_design_static ]]; then
148
		rm -rf man/_sphinx_design_static || die
149
	fi
152 150
	doman man/*
153
	use doc && local HTML_DOCS=( docs/build/html/. )
154 151
	einstalldocs
152

  
155 153
	# Generate the bash completions; we'll set PYTHONPATH for this invocation so that beets can start.
156 154
	PYTHONPATH="${ED}/usr/lib/${PYTHON}:$PYTHONPATH" ${PYTHON} "${ED}/usr/bin/beet" completion > "${T}/beet.bash" || die
157 155
	newbashcomp "${T}/beet.bash" beet
158
	insinto /usr/share/zsh/site-functions
159
	newins "${S}/extra/_beet" _beet
156
	newzshcomp "${S}/extra/_beet" _beet
160 157

  
161 158
	optfeature "badfiles support" "media-libs/flac media-sound/mp3val"
162 159
	optfeature "chromaprint support" "dev-python/pyacoustid media-libs/chromaprint[tools]"
......
171 168
	optfeature "thumbnail support" dev-python/pyxdg "dev-python/pillow media-gfx/imagemagick"
172 169
	optfeature "webserver support" dev-python/flask
173 170
	optfeature "webserver cors support" dev-python/flask-cors
171
	optfeature "Amarok metadata synchronisation" dev-python/dbus-python
174 172
}
Thank you!