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