1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 flit-core,
7 aiohttp,
8 pytz,
9 requests,
10 pytestCheckHook,
11 pytest-asyncio,
12 responses,
13}:
14
15buildPythonPackage rec {
16 pname = "fhir-py";
17 version = "1.4.2";
18 pyproject = true;
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "beda-software";
24 repo = "fhir-py";
25 rev = "refs/tags/v${version}";
26 hash = "sha256-kYqoRso1ypN5novRxMMzz1h2NGNybbw5lK4+HErG79I=";
27 };
28
29 preBuild = ''
30 substituteInPlace pyproject.toml \
31 --replace "--cov=fhirpy" "" \
32 --replace "--cov-report=xml" ""
33 '';
34
35 nativeBuildInputs = [ flit-core ];
36
37 propagatedBuildInputs = [
38 aiohttp
39 pytz
40 requests
41 ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 pytest-asyncio
46 responses
47 ];
48
49 # sync/async test cases require docker-compose to set up services, so disable:
50 disabledTestPaths = [ "tests/test_lib_sync.py" ];
51 disabledTests = [ "TestLibAsyncCase" ];
52
53 pythonImportsCheck = [ "fhirpy" ];
54
55 meta = with lib; {
56 description = "Async/sync API for FHIR resources";
57 homepage = "https://github.com/beda-software/fhir-py";
58 changelog = "https://github.com/beda-software/fhir-py/blob/${src.rev}/CHANGELOG.md";
59 license = licenses.mit;
60 maintainers = with maintainers; [ bcdarwin ];
61 };
62}