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 [
41 argcomplete
42 colorlog
43 packaging
44 virtualenv
45 ]
46 ++ lib.optionals (pythonOlder "3.11") [
47 tomli
48 ];
49
50 optional-dependencies = {
51 tox_to_nox = [
52 jinja2
53 tox
54 ];
55 uv = [ uv ];
56 };
57
58 nativeCheckInputs = [ pytestCheckHook ];
59
60 preCheck = ''
61 export HOME=$(mktemp -d)
62 '';
63
64 pythonImportsCheck = [ "nox" ];
65
66 disabledTests = [
67 # our conda is not available on 3.11
68 "test__create_venv_options"
69 # Assertion errors
70 "test_uv"
71 ];
72
73 disabledTestPaths = [
74 # AttributeError: module 'tox.config' has...
75 "tests/test_tox_to_nox.py"
76 ];
77
78 meta = with lib; {
79 description = "Flexible test automation for Python";
80 homepage = "https://nox.thea.codes/";
81 changelog = "https://github.com/wntrblm/nox/blob/${version}/CHANGELOG.md";
82 license = licenses.asl20;
83 maintainers = with maintainers; [
84 doronbehar
85 fab
86 ];
87 };
88}