1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 appdirs,
6 geojson,
7 hatchling,
8 requests,
9 pytestCheckHook,
10 requests-mock,
11 versioningit,
12}:
13
14buildPythonPackage rec {
15 pname = "datapoint";
16 version = "0.13.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "Perseudonymous";
21 repo = "datapoint-python";
22 tag = version;
23 hash = "sha256-vgwuoG/2Lzo56cAiXEYNPsXQYfx8Cwg0NJgojDBxoug=";
24 };
25
26 postPatch = ''
27 substituteInPlace pyproject.toml \
28 --replace-fail 'dynamic = ["version"]' 'version = "${version}"'
29 '';
30
31 build-system = [
32 hatchling
33 versioningit
34 ];
35
36 dependencies = [
37 appdirs
38 geojson
39 requests
40 ];
41
42 nativeCheckInputs = [
43 pytestCheckHook
44 requests-mock
45 ];
46
47 pythonImportsCheck = [ "datapoint" ];
48
49 meta = {
50 description = "Python interface to the Met Office's Datapoint API";
51 homepage = "https://github.com/Perseudonymous/datapoint-python";
52 changelog = "https://github.com/Perseudonymous/datapoint-python/blob/${src.tag}/CHANGELOG.md";
53 license = lib.licenses.gpl3Only;
54 maintainers = with lib.maintainers; [ dotlambda ];
55 };
56}