mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-12 18:59:50 +03:00
community/py3-coverage-conditional-plugin: new aport
This commit is contained in:
parent
a90ba7f3c4
commit
d11448edc2
2 changed files with 111 additions and 0 deletions
51
community/py3-coverage-conditional-plugin/APKBUILD
Normal file
51
community/py3-coverage-conditional-plugin/APKBUILD
Normal file
|
@ -0,0 +1,51 @@
|
|||
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
|
||||
pkgname=py3-coverage-conditional-plugin
|
||||
_pyname=coverage-conditional-plugin
|
||||
pkgver=0.9.0
|
||||
pkgrel=0
|
||||
pkgdesc="Conditional coverage based on any rules you define!"
|
||||
url="https://github.com/wemake-services/coverage-conditional-plugin"
|
||||
arch="noarch"
|
||||
license="MIT"
|
||||
depends="
|
||||
py3-coverage
|
||||
"
|
||||
makedepends="
|
||||
py3-setuptools
|
||||
py3-gpep517
|
||||
poetry
|
||||
"
|
||||
checkdepends="
|
||||
py3-pytest
|
||||
py3-pytest-cov
|
||||
py3-pytest-randomly
|
||||
"
|
||||
subpackages="$pkgname-pyc"
|
||||
source="
|
||||
$pkgname-$pkgver.tar.gz::https://github.com/wemake-services/coverage-conditional-plugin/archive/refs/tags/$pkgver.tar.gz
|
||||
py-312-313-support.patch
|
||||
"
|
||||
builddir="$srcdir"/$_pyname-$pkgver
|
||||
|
||||
build() {
|
||||
gpep517 build-wheel \
|
||||
--wheel-dir .dist \
|
||||
--output-fd 3 3>&1 >&2
|
||||
}
|
||||
|
||||
check() {
|
||||
python3 -m venv --clear --without-pip --system-site-packages .testenv
|
||||
.testenv/bin/python3 -m installer .dist/*.whl
|
||||
.testenv/bin/python3 -m pytest -v
|
||||
}
|
||||
|
||||
package() {
|
||||
python3 -m installer -d "$pkgdir" \
|
||||
.dist/*.whl
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
4cd28a3eb8f3cf3314df91a4316759eb4990b76ac7f78a81b5b2833cbf530fd0610a189177d375c75d20ca1f15b8425c3e05c3463538919e88d9a75c134b78be py3-coverage-conditional-plugin-0.9.0.tar.gz
|
||||
cfb991cb144dd6ea360c23adda1f49bbfd3d3b3fa2218879e9e030fb0124cc79b11211e56be9107c048bd605e644dbb05998d717f4f37dc075fe085c3338c6af py-312-313-support.patch
|
||||
"
|
|
@ -0,0 +1,60 @@
|
|||
diff --git a/test_project/pyproject.toml.orig b/test_project/pyproject.toml
|
||||
index 6284d4cb1d5..1a70c595702 100644
|
||||
--- a/test_project/pyproject.toml.orig
|
||||
+++ b/test_project/pyproject.toml
|
||||
@@ -19,3 +19,5 @@ py-gte-38 = "sys_version_info >= (3, 8)"
|
||||
py-gte-39 = "sys_version_info >= (3, 9)"
|
||||
py-gte-310 = "sys_version_info >= (3, 10)"
|
||||
py-gte-311 = "sys_version_info >= (3, 11)"
|
||||
+py-gte-312 = "sys_version_info >= (3, 12)"
|
||||
+py-gte-313 = "sys_version_info >= (3, 13)"
|
||||
diff --git a/test_project/example.py.orig b/test_project/example.py
|
||||
index 132d3f5100c..aa259cb5856 100644
|
||||
--- a/test_project/example.py.orig
|
||||
+++ b/test_project/example.py
|
||||
@@ -1,5 +1,13 @@
|
||||
from typing import Tuple
|
||||
|
||||
+def if_gte_python313() -> Tuple[int, int]: # pragma: py-gte-313
|
||||
+ """Test function for pragma ``py-gte-313``."""
|
||||
+ return (3, 13)
|
||||
+
|
||||
+def if_gte_python312() -> Tuple[int, int]: # pragma: py-gte-312
|
||||
+ """Test function for pragma ``py-gte-312``."""
|
||||
+ return (3, 12)
|
||||
+
|
||||
def if_gte_python311() -> Tuple[int, int]: # pragma: py-gte-311
|
||||
"""Test function for pragma ``py-gte-311``."""
|
||||
return (3, 11)
|
||||
diff --git a/tests/test_integration.py.orig b/tests/test_integration.py
|
||||
index 8123609e7c9..117814e8708 100644
|
||||
--- a/tests/test_integration.py.orig
|
||||
+++ b/tests/test_integration.py
|
||||
@@ -13,6 +13,8 @@ from test_project.example import (
|
||||
if_gte_python39,
|
||||
if_gte_python310,
|
||||
if_gte_python311,
|
||||
+ if_gte_python312,
|
||||
+ if_gte_python313,
|
||||
)
|
||||
|
||||
#: This is just our specific example.
|
||||
@@ -41,6 +43,8 @@ def test_integration(cov, capsys):
|
||||
if_gte_python39()
|
||||
if_gte_python310()
|
||||
if_gte_python311()
|
||||
+ if_gte_python312()
|
||||
+ if_gte_python313()
|
||||
always()
|
||||
|
||||
cov.json_report(outfile='-')
|
||||
diff --git a/test_project/.coveragerc.orig b/test_project/.coveragerc
|
||||
index d95926f2066..80591b3dacf 100644
|
||||
--- a/test_project/.coveragerc.orig
|
||||
+++ b/test_project/.coveragerc
|
||||
@@ -22,3 +22,5 @@ rules =
|
||||
"sys_version_info >= (3, 9)": py-gte-39
|
||||
"sys.version_info >= (3, 10)": py-gte-310
|
||||
"sys.version_info >= (3, 11)": py-gte-311
|
||||
+ "sys.version_info >= (3, 12)": py-gte-312
|
||||
+ "sys.version_info >= (3, 13)": py-gte-313
|
Loading…
Add table
Add a link
Reference in a new issue