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