Martin Weinelt ae4a1a485a
treewide: add explicit format attribute for Python packages
If a Python package does not come with either `format` or `pyproject` we
consider it a setuptools build, that calls `setup.py` directly, which is
deprecated.

This change, as a first step, migrates a large chunk of these packages to
set setuptools as their explicit format

This is so we can unify the problem space for the next step of the
migration.
2025-07-02 05:56:47 +02:00

86 lines
1.7 KiB
Nix

{
lib,
aiohttp,
aioresponses,
beautifulsoup4,
buildPythonPackage,
fetchFromGitHub,
html5lib,
pytest-asyncio,
pytest-aiohttp,
pytestCheckHook,
pythonAtLeast,
pythonOlder,
requests,
requests-mock,
setuptools,
setuptools-scm,
urllib3,
}:
buildPythonPackage rec {
pname = "raincloudy";
version = "1.2.0";
format = "setuptools";
pypriject = true;
# https://github.com/vanstinator/raincloudy/issues/65
disabled = pythonOlder "3.7" || pythonAtLeast "3.12";
src = fetchFromGitHub {
owner = "vanstinator";
repo = "raincloudy";
rev = "refs/tags/${version}";
hash = "sha256-qCkBVirM09iA1sXiOB9FJns8bHjQq7rRk8XbRWrtBDI=";
};
postPatch = ''
# https://github.com/vanstinator/raincloudy/pull/60
substituteInPlace setup.py \
--replace-fail "bs4" "beautifulsoup4" \
# fix raincloudy.aio package discovery, by relying on
# autodiscovery instead.
sed -i '/packages=/d' setup.py
'';
build-system = [
setuptools
setuptools-scm
];
dependencies = [
aiohttp
requests
beautifulsoup4
urllib3
html5lib
];
nativeCheckInputs = [
aioresponses
pytest-asyncio
pytest-aiohttp
pytestCheckHook
requests-mock
];
pythonImportsCheck = [
"raincloudy"
"raincloudy.aio"
];
disabledTests = [
# Test requires network access
"test_attributes"
];
meta = with lib; {
description = "Module to interact with Melnor RainCloud Smart Garden Watering Irrigation Timer";
homepage = "https://github.com/vanstinator/raincloudy";
changelog = "https://github.com/vanstinator/raincloudy/releases/tag/${version}";
license = licenses.asl20;
maintainers = with maintainers; [ fab ];
};
}