mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-17 14:42:01 +01:00
71 lines
1.8 KiB
Plaintext
71 lines
1.8 KiB
Plaintext
# Contributor: Galen Abell <galen@galenabell.com>
|
|
# Maintainer: Galen Abell <galen@galenabell.com>
|
|
pkgname=pre-commit
|
|
pkgver=2.14.0
|
|
pkgrel=0
|
|
pkgdesc="framework for managing and maintaining multi-language pre-commit hooks"
|
|
url="https://pre-commit.com"
|
|
arch="noarch !mips64" # blocked by npm
|
|
license="MIT"
|
|
depends="
|
|
python3
|
|
py3-cfgv
|
|
py3-identify
|
|
py3-nodeenv
|
|
py3-yaml
|
|
py3-toml
|
|
py3-virtualenv
|
|
"
|
|
makedepends="py3-setuptools"
|
|
checkdepends="
|
|
py3-pytest
|
|
py3-pytest-env
|
|
py3-re-assert
|
|
py3-distlib
|
|
ruby
|
|
npm
|
|
git
|
|
"
|
|
options="net"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/pre-commit/pre-commit/archive/refs/tags/v$pkgver.tar.gz
|
|
fix-importlib-metadata.patch
|
|
"
|
|
|
|
prepare() {
|
|
default_prepare
|
|
sed -i "s|%%PKGVER%%|'$pkgver'|g" pre_commit/constants.py
|
|
}
|
|
|
|
build() {
|
|
python3 setup.py build
|
|
}
|
|
|
|
check() {
|
|
export PYTHONPATH="."
|
|
|
|
# setup for some of the integration tests
|
|
git init
|
|
git config user.email "test@alpinelinux.org"
|
|
git config user.name "Alpine Linux"
|
|
export GIT_AUTHOR_NAME="Alpine Linux"
|
|
export GIT_COMMITTER_NAME="Alpine Linux"
|
|
export GIT_AUTHOR_EMAIL="test@alpinelinux.org"
|
|
export GIT_COMMITTER_EMAIL="test@alpinelinux.org"
|
|
export PRE_COMMIT_NO_CONCURRENCY=1
|
|
|
|
# skip some of the tests since they depend on non-packaged tools
|
|
PYTHONPATH="$PWD"/build/lib pytest -v \
|
|
--ignore tests/repository_test.py \
|
|
--deselect tests/languages/ruby_test.py::test_install_ruby_with_version \
|
|
--deselect tests/commands/install_uninstall_test.py::test_installed_from_venv
|
|
}
|
|
|
|
package() {
|
|
python3 setup.py install --prefix=/usr --root="$pkgdir"
|
|
}
|
|
|
|
sha512sums="
|
|
79581767e28cef82dea604656b03ed99d7014299aa4f49e25b4ed53244d7b62c46193e25ba6add9189613a5d1517859ccc7208d7d7238674a0a1ce2ed29f131a pre-commit-2.14.0.tar.gz
|
|
f89d337677d0dba903cb2b9441c5879ca14bd41854913b30e6a92f4310f5565f4777d4bd9a6939ce410699d0e2de40da8527d3f297a58992953c783f4139b733 fix-importlib-metadata.patch
|
|
"
|