1{
2 lib,
3 argcomplete,
4 buildPythonPackage,
5 colorlog,
6 fetchFromGitHub,
7 hatchling,
8 jinja2,
9 packaging,
10 pytestCheckHook,
11 pythonOlder,
12 tomli,
13 tox,
14 uv,
15 virtualenv,
16}:
17
18buildPythonPackage rec {
19 pname = "nox";
20 version = "2024.10.09";
21 pyproject = true;
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchFromGitHub {
26 owner = "wntrblm";
27 repo = "nox";
28 tag = version;
29 hash = "sha256-GdNz34A8IKwPG/270sY5t3SoggGCZMWfDq/Wyhk0ez8=";
30 };
31
32 patches = [
33 # Backport of https://github.com/wntrblm/nox/pull/903, which can be removed on next release
34 ./fix-broken-mock-on-cpython-3.12.8.patch
35 ];
36
37 build-system = [ hatchling ];
38
39 dependencies = [
40 argcomplete
41 colorlog
42 packaging
43 virtualenv
44 ]
45 ++ lib.optionals (pythonOlder "3.11") [
46 tomli
47 ];
48
49 optional-dependencies = {
50 tox_to_nox = [
51 jinja2
52 tox
53 ];
54 uv = [ uv ];
55 };
56
57 nativeCheckInputs = [ pytestCheckHook ];
58
59 preCheck = ''
60 export HOME=$(mktemp -d)
61 '';
62
63 pythonImportsCheck = [ "nox" ];
64
65 disabledTests = [
66 # our conda is not available on 3.11
67 "test__create_venv_options"
68 # Assertion errors
69 "test_uv"
70 ];
71
72 disabledTestPaths = [
73 # AttributeError: module 'tox.config' has...
74 "tests/test_tox_to_nox.py"
75 ];
76
77 meta = with lib; {
78 description = "Flexible test automation for Python";
79 homepage = "https://nox.thea.codes/";
80 changelog = "https://github.com/wntrblm/nox/blob/${version}/CHANGELOG.md";
81 license = licenses.asl20;
82 maintainers = with maintainers; [
83 doronbehar
84 fab
85 ];
86 };
87}