


























The package currently fails to build with the following error:
LookupError: setuptools-scm was unable to detect version for /home/<username>/.cache/yay/python-scienceplots/src/SciencePlots-2.2.0
The build uses --no-isolation which requires all build dependencies to be available in the build environment. Since the source tarball doesn't include .git metadata, setuptools-scm cannot automatically detect the version.
Two changes are needed:
python-setuptools-scm to makedepends:makedepends=(python-setuptools python-setuptools-scm python-build python-installer python-wheel)
build() function:build() {
cd ${_base}-${pkgver}
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
python -m build --wheel --skip-dependency-check --no-isolation
}
--- PKGBUILD
+++ PKGBUILD
@@ -9,11 +9,12 @@
url="https://github.com/garrettj403/${_base}"
license=(MIT)
depends=(python-matplotlib)
-makedepends=(python-setuptools python-build python-installer python-wheel)
+makedepends=(python-setuptools python-setuptools-scm python-build python-installer python-wheel)
source=(${_base}-${pkgver}.tar.gz::${url}/archive/${pkgver}.tar.gz)
sha512sums=('f8bd91f86f4034ea5d4fc2343649553c95be7d88c80e42d0506193ef8aef4a6ebb35cbb7413c93b15490d8db89c3eb8bfb268a7fc60b5404d572e33d9c3cf055')
conflicts=(python-${_base,,}-git)
build() {
cd ${_base}-${pkgver}
+ export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
python -m build --wheel --skip-dependency-check --no-isolation
}
With these changes, the package builds and installs successfully.
Thanks @yuhldr for the hint.
source=(${_base}.tar.gz::${url}/archive/${pkgver}.tar.gz)
The above line in PKGBUILD suggests deleting the custom filename '${_base}.tar.gz::$', or changing it to the following
source=(${_base}-${pkgver}-${pkgrel}.tar.gz::${url}/archive/${pkgver}.tar.gz)
Because this now causes the system to not download the latest source file, directly package it with the last file, and then report the sha512sums error if the last 'SciencePlots.tar.gz' is cached locally
Thanks @yuhldr for the hint.
python-setuptools may be makedepends?
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。
@bladewing Great fix! Can confirmed it worked for me!