1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 hatchling,
9
10 # dependencies
11 attrs,
12 argcomplete,
13 colorlog,
14 dependency-groups,
15 jinja2,
16 packaging,
17 tomli,
18
19 # tests
20 pytestCheckHook,
21 writableTmpDirAsHomeHook,
22
23 # passthru
24 tox,
25 uv,
26 virtualenv,
27}:
28
29buildPythonPackage rec {
30 pname = "nox";
31 version = "2025.05.01";
32 pyproject = true;
33
34 disabled = pythonOlder "3.12";
35
36 src = fetchFromGitHub {
37 owner = "wntrblm";
38 repo = "nox";
39 tag = version;
40 hash = "sha256-qH8oh7tmiJkXOobyDZMRZ62w2sRHJF8sh4PX+6s7M70=";
41 };
42
43 build-system = [ hatchling ];
44
45 dependencies = [
46 argcomplete
47 attrs
48 colorlog
49 dependency-groups
50 packaging
51 virtualenv
52 ]
53 ++ lib.optionals (pythonOlder "3.11") [
54 tomli
55 ];
56
57 optional-dependencies = {
58 tox_to_nox = [
59 jinja2
60 tox
61 ];
62 uv = [ uv ];
63 };
64
65 nativeCheckInputs = [
66 pytestCheckHook
67 writableTmpDirAsHomeHook
68 ];
69
70 pythonImportsCheck = [ "nox" ];
71
72 disabledTests = [
73 # Assertion errors
74 "test_uv"
75 # Test requires network access
76 "test_noxfile_script_mode_url_req"
77 # Don't test CLi mode
78 "test_noxfile_script_mode"
79 ];
80
81 disabledTestPaths = [
82 # AttributeError: module 'tox.config' has...
83 "tests/test_tox_to_nox.py"
84 ];
85
86 meta = {
87 description = "Flexible test automation for Python";
88 homepage = "https://nox.thea.codes/";
89 changelog = "https://github.com/wntrblm/nox/blob/${src.tag}/CHANGELOG.md";
90 license = lib.licenses.asl20;
91 maintainers = with lib.maintainers; [
92 doronbehar
93 fab
94 ];
95 };
96}