1{ lib, fetchFromGitHub, buildPythonApplication
2, pythonOlder
3, aiohttp
4, appdirs
5, beautifulsoup4
6, defusedxml
7, devpi-common
8, execnet
9, itsdangerous
10, nginx
11, packaging
12, passlib
13, platformdirs
14, pluggy
15, py
16, httpx
17, pyramid
18, pytestCheckHook
19, repoze-lru
20, setuptools
21, strictyaml
22, waitress
23, webtest
24, testers
25, devpi-server
26, nixosTests
27}:
28
29
30buildPythonApplication rec {
31 pname = "devpi-server";
32 version = "6.10.0";
33 pyproject = true;
34
35 disabled = pythonOlder "3.7";
36
37 src = fetchFromGitHub {
38 owner = "devpi";
39 repo = "devpi";
40 rev = "server-${version}";
41 hash = "sha256-JqYWWItdAgtUtiYSqxUd40tT7ON4oHiDA4/3Uhb01b8=";
42 };
43
44 sourceRoot = "${src.name}/server";
45
46 postPatch = ''
47 substituteInPlace tox.ini \
48 --replace "--flake8" ""
49 '';
50
51 nativeBuildInputs = [
52 setuptools
53 ];
54
55 propagatedBuildInputs = [
56 aiohttp
57 appdirs
58 defusedxml
59 devpi-common
60 execnet
61 itsdangerous
62 packaging
63 passlib
64 platformdirs
65 pluggy
66 pyramid
67 repoze-lru
68 setuptools
69 strictyaml
70 waitress
71 py
72 httpx
73 ] ++ passlib.optional-dependencies.argon2;
74
75 nativeCheckInputs = [
76 beautifulsoup4
77 nginx
78 py
79 pytestCheckHook
80 webtest
81 ];
82
83 # root_passwd_hash tries to write to store
84 # TestMirrorIndexThings tries to write to /var through ngnix
85 # nginx tests try to write to /var
86 preCheck = ''
87 export PATH=$PATH:$out/bin
88 export HOME=$TMPDIR
89 '';
90 pytestFlagsArray = [
91 "./test_devpi_server"
92 "-rfsxX"
93 "--ignore=test_devpi_server/test_nginx_replica.py"
94 "--ignore=test_devpi_server/test_streaming_nginx.py"
95 "--ignore=test_devpi_server/test_streaming_replica_nginx.py"
96 ];
97 disabledTests = [
98 "root_passwd_hash_option"
99 "TestMirrorIndexThings"
100 "test_auth_mirror_url_no_hash"
101 "test_auth_mirror_url_with_hash"
102 "test_auth_mirror_url_hidden_in_logs"
103 "test_simplelinks_timeout"
104 ];
105
106 __darwinAllowLocalNetworking = true;
107
108 pythonImportsCheck = [
109 "devpi_server"
110 ];
111
112 passthru.tests = {
113 devpi-server = nixosTests.devpi-server;
114 version = testers.testVersion {
115 package = devpi-server;
116 };
117 };
118
119 meta = with lib;{
120 homepage = "http://doc.devpi.net";
121 description = "Github-style pypi index server and packaging meta tool";
122 changelog = "https://github.com/devpi/devpi/blob/${src.rev}/server/CHANGELOG";
123 license = licenses.mit;
124 maintainers = with maintainers; [ makefu ];
125 };
126}