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