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