1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 jsonschema,
6 poetry-core,
7 pymacaroons,
8 pytest-cov-stub,
9 pytest-mock,
10 pytestCheckHook,
11 pythonOlder,
12 typing-extensions,
13}:
14
15buildPythonPackage rec {
16 pname = "pypitoken";
17 version = "7.0.1";
18 pyproject = true;
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "ewjoachim";
24 repo = "pypitoken";
25 tag = version;
26 hash = "sha256-1SUR6reZywgFpSdD49E5PjEDNrlvsHH4TK6SkXStUws=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace-fail 'version = "0.0.0"' 'version = "${version}"'
32 '';
33
34 build-system = [ poetry-core ];
35
36 dependencies = [
37 pymacaroons
38 jsonschema
39 typing-extensions
40 ];
41
42 nativeCheckInputs = [
43 pytest-cov-stub
44 pytest-mock
45 pytestCheckHook
46 ];
47
48 pythonImportsCheck = [ "pypitoken" ];
49
50 meta = with lib; {
51 description = "Library for generating and manipulating PyPI tokens";
52 homepage = "https://pypitoken.readthedocs.io/";
53 changelog = "https://github.com/ewjoachim/pypitoken/releases/tag/${version}";
54 license = licenses.mit;
55 maintainers = with maintainers; [ fab ];
56 };
57}