Files
nixpkgs/pkgs/development/python-modules/async-upnp-client/default.nix
T
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

78 lines
1.6 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
# build-system
setuptools,
# dependencies
aiohttp,
async-timeout,
defusedxml,
python-didl-lite,
voluptuous,
# tests
pytest-aiohttp,
pytest-asyncio,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "async-upnp-client";
version = "0.40.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "StevenLooman";
repo = "async_upnp_client";
rev = "refs/tags/${version}";
hash = "sha256-KaX1TNP6IP2wAijR2y9cqI+Pyc+Ygk3LqKwu5Yrv5LM=";
};
pythonRelaxDeps = [ "defusedxml" ];
build-system = [ setuptools ];
dependencies = [
aiohttp
async-timeout
defusedxml
python-didl-lite
voluptuous
];
nativeCheckInputs = [
pytestCheckHook
pytest-aiohttp
pytest-asyncio
];
disabledTests = [
# socket.gaierror: [Errno -2] Name or service not known
"test_async_get_local_ip"
"test_get_local_ip"
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_deferred_callback_url" ];
disabledTestPaths = [
# Tries to bind to multicast socket and fails to find proper interface
"tests/test_ssdp_listener.py"
];
pythonImportsCheck = [ "async_upnp_client" ];
meta = with lib; {
description = "Asyncio UPnP Client library for Python";
homepage = "https://github.com/StevenLooman/async_upnp_client";
changelog = "https://github.com/StevenLooman/async_upnp_client/blob/${version}/CHANGES.rst";
license = licenses.asl20;
maintainers = with maintainers; [ hexa ];
mainProgram = "upnp-client";
};
}