void-packages/srcpkgs/black/template

32 lines
1.3 KiB
Bash

# Template file for 'black'
pkgname=black
version=22.8.0
revision=1
build_style=python3-module
hostmakedepends="python3-wheel python3-setuptools_scm"
depends="python3-click python3-platformdirs python3-tomli python3-pathspec python3-mypy_extensions"
checkdepends="${depends} python3-pytest-xdist python3-aiohttp python3-colorama python3-uvloop
python3-ipython python3-tokenize-rt"
short_desc="Uncompromising Python code formatter"
maintainer="icp <pangolin@vivaldi.net>"
license="MIT"
homepage="https://github.com/psf/black"
changelog="https://raw.githubusercontent.com/psf/black/main/CHANGES.md"
distfiles="${PYPI_SITE}/b/black/black-${version}.tar.gz"
checksum=792f7eb540ba9a17e8656538701d3eb1afcb134e3b45b71f20b25c77a8db7e6e
do_check() {
PYTHONPATH="$(cd build/lib* && pwd)" python3 -m pytest --run-optional jupyter -m jupyter
pyver=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
mv ${XBPS_MASTERDIR}/usr/lib/python${pyver}/site-packages/IPython ${XBPS_MASTERDIR}/tmp/IPython.bak
PYTHONPATH="$(cd build/lib* && pwd)" python3 -m pytest --run-optional no_jupyter
mv ${XBPS_MASTERDIR}/tmp/IPython.bak ${XBPS_MASTERDIR}/usr/lib/python${pyver}/site-packages/IPython
PYTHONPATH="$(cd build/lib* && pwd)" python3 -m black --check src tests setup.py
}
post_install() {
vlicense LICENSE
}