nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, poetry
5, pytestCheckHook
6, pythonOlder
7, pytz
8, requests
9, requests-mock
10, typing-extensions
11, urllib3
12}:
13
14buildPythonPackage rec {
15 pname = "meteofrance-api";
16 version = "1.0.2";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.6";
20
21 src = fetchFromGitHub {
22 owner = "hacf-fr";
23 repo = pname;
24 rev = "v${version}";
25 hash = "sha256-X8f0z9ZPXH7Wc3GqHmPptxpNxbHeezdOzw4gZCprumU=";
26 };
27
28 nativeBuildInputs = [
29 # Doesn't work with poetry-core at the moment
30 poetry
31 ];
32
33 propagatedBuildInputs = [
34 pytz
35 requests
36 urllib3
37 ] ++ lib.optionals (pythonOlder "3.7") [
38 typing-extensions
39 ];
40
41 checkInputs = [
42 pytestCheckHook
43 requests-mock
44 ];
45
46 postPatch = ''
47 # https://github.com/hacf-fr/meteofrance-api/pull/378
48 substituteInPlace pyproject.toml \
49 --replace 'pytz = ">=2020.4,<2022.0"' 'pytz = ">=2020.4,<2023.0"'
50 '';
51
52 pythonImportsCheck = [
53 "meteofrance_api"
54 ];
55
56 disabledTests = [
57 # Tests require network access
58 "test_currentphenomenons"
59 "test_forecast"
60 "test_full_with_coastal_bulletint"
61 "test_fulls"
62 "test_no_rain_expected"
63 "test_picture_of_the_day"
64 "test_places"
65 "test_rain"
66 "test_session"
67 "test_workflow"
68 ];
69
70 meta = with lib; {
71 description = "Module to access information from the Meteo-France API";
72 homepage = "https://github.com/hacf-fr/meteofrance-api";
73 license = licenses.mit;
74 maintainers = with maintainers; [ fab ];
75 };
76}