nixpkgs/pkgs/development/python-modules/python-jenkins/default.nix
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

69 lines
1.6 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
mock,
pbr,
pyyaml,
setuptools,
six,
multi-key-dict,
testscenarios,
requests,
requests-mock,
stestr,
multiprocess,
}:
buildPythonPackage rec {
pname = "python-jenkins";
version = "1.8.2";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-VufauwYHvbjh1vxtLUMBq+2+2RZdorIG+svTBxy27ss=";
};
# test uses timeout mechanism unsafe for use with the "spawn"
# multiprocessing backend used on macos
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace tests/test_jenkins_sockets.py \
--replace test_jenkins_open_no_timeout dont_test_jenkins_open_no_timeout
'';
pythonRelaxDeps = [ "setuptools" ];
buildInputs = [ mock ];
propagatedBuildInputs = [
pbr
pyyaml
setuptools
six
multi-key-dict
requests
];
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [
stestr
testscenarios
requests-mock
multiprocess
];
checkPhase = ''
# Skip tests that fail due to setuptools>=66.0.0 rejecting PEP 440
# non-conforming versions. See
# https://github.com/pypa/setuptools/issues/2497 for details.
stestr run -E "tests.test_plugins.(PluginsTestScenarios.test_plugin_version_comparison|PluginsTestScenarios.test_plugin_version_object_comparison|PluginsTest.test_plugin_equal|PluginsTest.test_plugin_not_equal)"
'';
meta = with lib; {
description = "Python bindings for the remote Jenkins API";
homepage = "https://pypi.python.org/pypi/python-jenkins";
license = licenses.bsd3;
maintainers = with maintainers; [ gador ];
};
}