Files
nixpkgs/pkgs/development/python-modules/oslo-log/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

67 lines
1.2 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
eventlet,
oslo-config,
oslo-context,
oslo-serialization,
oslo-utils,
oslotest,
pbr,
pyinotify,
python-dateutil,
pytestCheckHook,
pythonOlder,
setuptools,
}:
buildPythonPackage rec {
pname = "oslo-log";
version = "6.1.2";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchPypi {
pname = "oslo.log";
inherit version;
hash = "sha256-92gEffnXBsSE3WZl3LvqKJAh1Iy3zlq/eh9poJSR9f4=";
};
build-system = [ setuptools ];
dependencies = [
oslo-config
oslo-context
oslo-serialization
oslo-utils
pbr
python-dateutil
] ++ lib.optionals stdenv.hostPlatform.isLinux [ pyinotify ];
nativeCheckInputs = [
eventlet
oslotest
pytestCheckHook
];
disabledTests = [
# not compatible with sandbox
"test_logging_handle_error"
# File which is used doesn't seem not to be present
"test_log_config_append_invalid"
];
pythonImportsCheck = [ "oslo_log" ];
meta = with lib; {
description = "oslo.log library";
mainProgram = "convert-json";
homepage = "https://github.com/openstack/oslo.log";
license = licenses.asl20;
maintainers = teams.openstack.members;
};
}