nixpkgs/pkgs/development/python-modules/pip-tools/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

83 lines
1.8 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
build,
click,
fetchPypi,
pep517,
pip,
pytest-xdist,
pytestCheckHook,
pythonOlder,
setuptools,
setuptools-scm,
tomli,
tomli-w,
wheel,
}:
buildPythonPackage rec {
pname = "pip-tools";
version = "7.4.1";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-hkgm9Qc4ZEUOJNvuuFzjkgzfsJhIo9aev1N7Uh8UvMk=";
};
patches = [ ./fix-setup-py-bad-syntax-detection.patch ];
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [
build
click
pep517
pip
setuptools
wheel
] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [
pytest-xdist
pytestCheckHook
tomli-w
];
preCheck = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
# https://github.com/python/cpython/issues/74570#issuecomment-1093748531
export no_proxy='*';
'';
disabledTests = [
# Tests require network access
"network"
"test_direct_reference_with_extras"
"test_local_duplicate_subdependency_combined"
"test_bad_setup_file"
# Assertion error
"test_compile_recursive_extras"
"test_combine_different_extras_of_the_same_package"
"test_diff_should_not_uninstall"
"test_cli_compile_all_extras_with_multiple_packages"
# Deprecations
"test_error_in_pyproject_toml"
];
pythonImportsCheck = [ "piptools" ];
meta = with lib; {
description = "Keeps your pinned dependencies fresh";
homepage = "https://github.com/jazzband/pip-tools/";
changelog = "https://github.com/jazzband/pip-tools/releases/tag/${version}";
license = licenses.bsd3;
maintainers = with maintainers; [ zimbatm ];
};
}