1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 hatch-fancy-pypi-readme,
7 hatch-vcs,
8 hatchling,
9 pydantic,
10 freezegun,
11 pytestCheckHook,
12}:
13
14buildPythonPackage rec {
15 pname = "python-ulid";
16 version = "3.0.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.9";
20
21 src = fetchFromGitHub {
22 owner = "mdomke";
23 repo = "python-ulid";
24 tag = version;
25 hash = "sha256-ZMz1LqGJDgaMq4BNU33OPOQfoXFFuwFGcplnqtXSOHA=";
26 };
27
28 build-system = [
29 hatch-fancy-pypi-readme
30 hatch-vcs
31 hatchling
32 ];
33
34 optional-dependencies = {
35 pydantic = [ pydantic ];
36 };
37
38 nativeCheckInputs = [
39 freezegun
40 pytestCheckHook
41 ] ++ optional-dependencies.pydantic;
42
43 pythonImportsCheck = [ "ulid" ];
44
45 meta = with lib; {
46 description = "ULID implementation for Python";
47 mainProgram = "ulid";
48 homepage = "https://github.com/mdomke/python-ulid";
49 changelog = "https://github.com/mdomke/python-ulid/blob/${src.tag}/CHANGELOG.rst";
50 license = licenses.mit;
51 maintainers = with maintainers; [ natsukium ];
52 };
53}