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.15.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-tKR1xZju5bDbFu8t3SunTM8FlaXodSm/OjJ3Jfl7Dzk=";
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 ]
77 ++ passlib.optional-dependencies.argon2;
78
79 nativeCheckInputs = [
80 beautifulsoup4
81 nginx
82 py
83 pytestCheckHook
84 webtest
85 ];
86
87 # root_passwd_hash tries to write to store
88 # TestMirrorIndexThings tries to write to /var through ngnix
89 # nginx tests try to write to /var
90 preCheck = ''
91 export PATH=$PATH:$out/bin
92 export HOME=$TMPDIR
93 '';
94 pytestFlags = [
95 "-rfsxX"
96 ];
97 enabledTestPaths = [
98 "./test_devpi_server"
99 ];
100 disabledTestPaths = [
101 "test_devpi_server/test_nginx_replica.py"
102 "test_devpi_server/test_streaming_nginx.py"
103 "test_devpi_server/test_streaming_replica_nginx.py"
104 ];
105 disabledTests = [
106 "root_passwd_hash_option"
107 "TestMirrorIndexThings"
108 "test_auth_mirror_url_no_hash"
109 "test_auth_mirror_url_with_hash"
110 "test_auth_mirror_url_hidden_in_logs"
111 "test_simplelinks_timeout"
112 ];
113
114 __darwinAllowLocalNetworking = true;
115
116 pythonImportsCheck = [
117 "devpi_server"
118 ];
119
120 passthru.tests = {
121 devpi-server = nixosTests.devpi-server;
122 version = testers.testVersion {
123 package = devpi-server;
124 };
125 };
126
127 # devpi uses a monorepo for server,common,client and web
128 passthru.updateScript = gitUpdater {
129 rev-prefix = "server-";
130 };
131
132 meta = with lib; {
133 homepage = "http://doc.devpi.net";
134 description = "Github-style pypi index server and packaging meta tool";
135 changelog = "https://github.com/devpi/devpi/blob/${src.rev}/server/CHANGELOG";
136 license = licenses.mit;
137 maintainers = with maintainers; [ makefu ];
138 };
139}