python312Packages.weconnect-mqtt: refactor, python312Packages.withings-api: refactor, python312Packages.twentemilieu: migrate to pytest-cov-stub (#372914)

This commit is contained in:
Fabian Affolter
2025-01-11 20:13:18 +01:00
committed by GitHub
4 changed files with 36 additions and 24 deletions
@@ -1,14 +1,15 @@
{
lib,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
aiohttp,
yarl,
aresponses,
buildPythonPackage,
fetchFromGitHub,
poetry-core,
pytest-asyncio,
pytest-cov-stub,
pytestCheckHook,
pythonOlder,
yarl,
}:
buildPythonPackage rec {
@@ -26,8 +27,8 @@ buildPythonPackage rec {
};
postPatch = ''
# Upstream is creating GitHub releases without version
substituteInPlace pyproject.toml \
--replace "--cov" "" \
--replace '"0.0.0"' '"${version}"'
'';
@@ -41,6 +42,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
aresponses
pytest-asyncio
pytest-cov-stub
pytestCheckHook
];
@@ -3,6 +3,7 @@
buildPythonPackage,
fetchFromGitHub,
paho-mqtt_2,
pytest-cov-stub,
pytestCheckHook,
python-dateutil,
pythonOlder,
@@ -30,8 +31,7 @@ buildPythonPackage rec {
substituteInPlace requirements.txt \
--replace-fail "weconnect[Images]~=" "weconnect>="
substituteInPlace pytest.ini \
--replace-fail "--cov=weconnect_mqtt --cov-config=.coveragerc --cov-report html" "" \
--replace-fail "pytest-cov" ""
--replace-fail "required_plugins = pytest-cov" ""
'';
pythonRelaxDeps = [ "python-dateutil" ];
@@ -44,7 +44,10 @@ buildPythonPackage rec {
weconnect
] ++ weconnect.optional-dependencies.Images;
nativeCheckInputs = [ pytestCheckHook ];
nativeCheckInputs = [
pytest-cov-stub
pytestCheckHook
];
pythonImportsCheck = [ "weconnect_mqtt" ];
@@ -52,7 +55,7 @@ buildPythonPackage rec {
description = "Python client that publishes data from Volkswagen WeConnect";
homepage = "https://github.com/tillsteinbach/WeConnect-mqtt";
changelog = "https://github.com/tillsteinbach/WeConnect-mqtt/releases/tag/v${version}";
license = with lib.licenses; [ mit ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fab ];
mainProgram = "weconnect-mqtt";
};
@@ -5,6 +5,7 @@
fetchFromGitHub,
oauthlib,
pillow,
pytest-cov-stub,
pytestCheckHook,
pythonOlder,
requests,
@@ -32,13 +33,12 @@ buildPythonPackage rec {
--replace-fail "setup_requires=SETUP_REQUIRED" "setup_requires=[]" \
--replace-fail "tests_require=TEST_REQUIRED" "tests_require=[]"
substituteInPlace pytest.ini \
--replace-fail "--cov=weconnect --cov-config=.coveragerc --cov-report html" "" \
--replace-fail "required_plugins = pytest-cov" ""
'';
nativeBuildInputs = [ setuptools ];
build-system = [ setuptools ];
propagatedBuildInputs = [
dependencies = [
oauthlib
requests
];
@@ -50,7 +50,10 @@ buildPythonPackage rec {
];
};
nativeCheckInputs = [ pytestCheckHook ];
nativeCheckInputs = [
pytest-cov-stub
pytestCheckHook
];
pythonImportsCheck = [ "weconnect" ];
@@ -58,7 +61,7 @@ buildPythonPackage rec {
description = "Python client for the Volkswagen WeConnect Services";
homepage = "https://github.com/tillsteinbach/WeConnect-python";
changelog = "https://github.com/tillsteinbach/WeConnect-python/releases/tag/v${version}";
license = with licenses; [ mit ];
license = licenses.mit;
maintainers = with maintainers; [ fab ];
};
}
@@ -1,21 +1,22 @@
{
lib,
arrow,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
poetry-core,
arrow,
requests-oauthlib,
typing-extensions,
pydantic,
responses,
pytest-cov-stub,
pytestCheckHook,
pythonOlder,
requests-oauthlib,
responses,
typing-extensions,
}:
buildPythonPackage rec {
pname = "withings-api";
version = "2.4.0";
format = "pyproject";
pyproject = true;
disabled = pythonOlder "3.6";
@@ -28,13 +29,12 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'requests-oauth = ">=0.4.1"' ''' \
--replace 'addopts = "--capture no --cov ./withings_api --cov-report html:build/coverage_report --cov-report term --cov-report xml:build/coverage.xml"' '''
--replace-fail 'requests-oauth = ">=0.4.1"' '''
'';
nativeBuildInputs = [ poetry-core ];
build-system = [ poetry-core ];
propagatedBuildInputs = [
dependencies = [
arrow
requests-oauthlib
typing-extensions
@@ -42,13 +42,17 @@ buildPythonPackage rec {
];
nativeCheckInputs = [
pytest-cov-stub
pytestCheckHook
responses
];
pythonImportsCheck = [ "withings_api" ];
meta = with lib; {
description = "Library for the Withings Health API";
homepage = "https://github.com/vangorra/python_withings_api";
changelog = "https://github.com/vangorra/python_withings_api/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ kittywitch ];
broken = versionAtLeast pydantic.version "2";