Date: Wednesday, December 1, 2021 @ 11:15:28
Author: foutrelis
Revision: 1059123
archrelease: copy trunk to community-staging-any
Added:
python-tensorboard_plugin_wit/repos/community-staging-any/
python-tensorboard_plugin_wit/repos/community-staging-any/PKGBUILD
(from rev 1059122, python-tensorboard_plugin_wit/trunk/PKGBUILD)
----------+
PKGBUILD | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
Copied: python-tensorboard_plugin_wit/repos/community-staging-any/PKGBUILD
(from rev 1059122, python-tensorboard_plugin_wit/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD (rev 0)
+++ community-staging-any/PKGBUILD 2021-12-01 11:15:28 UTC (rev 1059123)
@@ -0,0 +1,75 @@
+# Maintainer: Konstantin Gizdov <arch at kge dot pw>
+
+pkgbase=python-tensorboard_plugin_wit
+pkgname=(python-tensorboard_plugin_wit python-witwidget)
+_pkgbase=tensorboard_plugin_wit
+_bzlver=3.6.0 # latest Bazel that is supported for building
+pkgdesc='The What-If Tool (WIT): An easy-to-use interface for expanding
understanding of a black-box classification or regression ML model.'
+url='https://pair-code.github.io/what-if-tool'
+license=('Apache')
+pkgver=1.8.1
+pkgrel=2
+arch=('any')
+source=("${_pkgbase}-${pkgver}::git+https://github.com/PAIR-code/what-if-tool#tag=v${pkgver}"
+
"https://github.com/bazelbuild/bazel/releases/download/${_bzlver}/bazel-${_bzlver}-linux-x86_64"{,.sig})
+_common_depends=('python-google-api-python-client' 'python-ipywidgets')
+makedepends=('git' 'jupyter' 'npm' 'python-virtualenv' 'python-pip'
"${_common_depends[@]}")
+validpgpkeys=('71A1D0EFCFEB6281FD0437C93D5919B448457EE0') # "Bazel Developer
(Bazel APT repository key) <[email protected]>"
+depends=('python-werkzeug' 'tensorboard')
+sha256sums=('SKIP'
+ 'b2985c3ad1ec0284a66749b635ac11b323bc6b964d2cfcf33721746243a19530'
+ 'SKIP')
+
+get_pyver () {
+ python -c 'import sys; print(str(sys.version_info[0]) + "." +
str(sys.version_info[1]))'
+}
+
+_bzlcmd () {
+ echo "${srcdir}/bazel-${_bzlver}-local-binary"
+}
+
+prepare() {
+ cp "${srcdir}/bazel-${_bzlver}-linux-x86_64" "$(_bzlcmd)"
+ chmod +x "$(_bzlcmd)"
+ cd "${srcdir}/${_pkgbase}-${pkgver}"
+ sed -e "s@version=\"1.8.0\"@version=\"${pkgver}\"@g" -i \
+ tensorboard_plugin_wit/pip_package/setup.py
+ sed -e 's@/tmp/wit-pip@${BUILD_WORKSPACE_DIRECTORY}/wit-pip@g' -i \
+ tensorboard_plugin_wit/pip_package/build_pip_package.sh \
+ witwidget/pip_package/build_pip_package.sh
+}
+
+build() {
+ cd "${srcdir}/${_pkgbase}-${pkgver}"
+ "$(_bzlcmd)" --output_user_root "${srcdir}/build-plugin" run
--incompatible_restrict_string_escapes=false
tensorboard_plugin_wit/pip_package:build_pip_package
+
+ cd "${srcdir}/${_pkgbase}-${pkgver}"
+ "$(_bzlcmd)" --output_user_root "${srcdir}/build-witwidget" run
--incompatible_restrict_string_escapes=false
witwidget/pip_package:build_pip_package
+}
+
+package_python-tensorboard_plugin_wit() {
+ provides=('tensorboard_plugin_wit')
+ optdepends=('tensorflow-serving-api: TensorFlow Classification, Regression,
or Predict APIs')
+ local _pyver="$(get_pyver)"
+ cd "${srcdir}/${_pkgbase}-${pkgver}"
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir"
--ignore-installed --no-deps
wit-pip/release/dist/tensorboard_plugin_wit-${pkgver}-py3*.whl
+}
+package_python-witwidget() {
+ pkgdesc='What-If Tool Notebook Widget.'
+ provides=('witwidget' 'witwidget-gpu')
+ depends=("${_common_depends[@]}" 'python-tensorboard_plugin_wit')
+ optdepends=(
+ 'jupyter: Jupyter support'
+ 'python-tensorflow-serving-api: browse model thorugh TensorFlow Serving
API'
+ 'python-tensorflow-estimator: browse model as a TensorFlow Estimator
feature spec'
+ )
+ local _pyver="$(get_pyver)"
+ cd "${srcdir}/${_pkgbase}-${pkgver}"
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir"
--ignore-installed --no-deps wit-pip/release/dist/witwidget-${pkgver}-py3*.whl
+ rm -rf "${pkgdir}/usr/lib/python${_pyver}/site-packages/${_pkgbase}"
+ install -d "${pkgdir}/etc/jupyter/nbconfig/notebook.d"
+ mv "${pkgdir}/usr/etc/jupyter/nbconfig/notebook.d/wit-widget.json"
"${pkgdir}/etc/jupyter/nbconfig/notebook.d/wit-widget.json"
+ rm -rf "${pkgdir}/usr/etc"
+}