1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 build,
6 click,
7 fetchPypi,
8 pep517,
9 pip,
10 pytest-xdist,
11 pytestCheckHook,
12 pythonOlder,
13 setuptools,
14 setuptools-scm,
15 tomli,
16 tomli-w,
17 wheel,
18}:
19
20buildPythonPackage rec {
21 pname = "pip-tools";
22 version = "7.4.1";
23 pyproject = true;
24
25 disabled = pythonOlder "3.8";
26
27 src = fetchPypi {
28 inherit pname version;
29 hash = "sha256-hkgm9Qc4ZEUOJNvuuFzjkgzfsJhIo9aev1N7Uh8UvMk=";
30 };
31
32 patches = [ ./fix-setup-py-bad-syntax-detection.patch ];
33
34 build-system = [ setuptools-scm ];
35
36 dependencies = [
37 build
38 click
39 pep517
40 pip
41 setuptools
42 wheel
43 ] ++ lib.optionals (pythonOlder "3.11") [ tomli ];
44
45 __darwinAllowLocalNetworking = true;
46
47 nativeCheckInputs = [
48 pytest-xdist
49 pytestCheckHook
50 tomli-w
51 ];
52
53 preCheck = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
54 # https://github.com/python/cpython/issues/74570#issuecomment-1093748531
55 export no_proxy='*';
56 '';
57
58 disabledTests = [
59 # Tests require network access
60 "network"
61 "test_direct_reference_with_extras"
62 "test_local_duplicate_subdependency_combined"
63 "test_bad_setup_file"
64 # Assertion error
65 "test_compile_recursive_extras"
66 "test_combine_different_extras_of_the_same_package"
67 "test_diff_should_not_uninstall"
68 "test_cli_compile_all_extras_with_multiple_packages"
69 # Deprecations
70 "test_error_in_pyproject_toml"
71
72 # pip 25.0 compat issues
73 # https://github.com/jazzband/pip-tools/issues/2112
74 # requirement doesn't end with semicolon
75 "test_resolver"
76 "test_resolver__custom_unsafe_deps"
77 # constraints.txt is now in a tmpdir
78 "test_preserve_via_requirements_constrained_dependencies_when_run_twice"
79 "test_annotate_option"
80 # TypeError("'<' not supported between instances of 'InstallationCandidate' and 'InstallationCandidate'")>.exit_code
81 "test_no_candidates"
82 "test_no_candidates_pre"
83 "test_failure_of_legacy_resolver_prompts_for_backtracking"
84 ];
85
86 pythonImportsCheck = [ "piptools" ];
87
88 meta = with lib; {
89 description = "Keeps your pinned dependencies fresh";
90 homepage = "https://github.com/jazzband/pip-tools/";
91 changelog = "https://github.com/jazzband/pip-tools/releases/tag/${version}";
92 license = licenses.bsd3;
93 maintainers = with maintainers; [ zimbatm ];
94 };
95}