Date: Sunday, April 9, 2023 @ 18:14:28
Author: felixonmars
Revision: 1443392
archrelease: copy trunk to community-staging-any
Added:
python-pytest-socket/repos/community-staging-any/
python-pytest-socket/repos/community-staging-any/PKGBUILD
(from rev 1443391, python-pytest-socket/trunk/PKGBUILD)
----------+
PKGBUILD | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
Copied: python-pytest-socket/repos/community-staging-any/PKGBUILD (from rev
1443391, python-pytest-socket/trunk/PKGBUILD)
===================================================================
--- community-staging-any/PKGBUILD (rev 0)
+++ community-staging-any/PKGBUILD 2023-04-09 18:14:28 UTC (rev 1443392)
@@ -0,0 +1,39 @@
+# Maintainer: Felix Yan <[email protected]>
+
+_name=pytest-socket
+pkgname=python-pytest-socket
+pkgver=0.6.0
+pkgrel=2
+pkgdesc='Pytest Plugin to disable socket calls during tests'
+arch=('any')
+license=('MIT')
+url='https://github.com/miketheman/pytest-socket'
+depends=('python-pytest')
+makedepends=('python-build' 'python-installer' 'python-poetry-core'
'python-wheel')
+checkdepends=('python-asynctest' 'python-pytest-cov' 'python-pytest-flake8'
'python-pytest-httpbin'
+ 'python-httpx' 'python-requests' 'python-starlette')
+source=("https://github.com/miketheman/pytest-socket/archive/$pkgver/$pkgname-$pkgver.tar.gz")
+sha512sums=('b70ab9fe3c41a707f16b6ae23d45e07238d03a731b3f99b794a6707303cd0301b75360ea164b7de48e9f2d56b5544e2da39373ba14a3b0fc20ef03afce03ab03')
+
+build() {
+ cd $_name-$pkgver
+ python -m build --wheel --no-isolation
+}
+
+check() {
+ local site_packages=$(python -c "import site;
print(site.getsitepackages()[0])")
+
+ cd $_name-$pkgver
+ # install to temporary location, as importlib is used
+ python -m installer --destdir=test_dir dist/*.whl
+ export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH"
+ pytest -vv
+}
+
+package() {
+ cd $_name-$pkgver
+ python -m installer --destdir="$pkgdir" dist/*.whl
+ install -vDm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
+}
+
+# vim:set ts=2 sw=2 et: