summary refs log blame commit diff
path: root/pkgs/development/python-modules/pyatmo/default.nix
blob: 5cd314b6cb993d3f59bb3d89945ecdc1bb050407 (plain) (tree)
1
2
3
4
5
6
7
8
9
     
         
                    
                 
           
          
                
             
                 


                   
               
                



                        
                    
                        

                               
 

                         
                    
                        
                                                                   

    




                                           

                           
           



                     
 

                 
                  
               



                   





                                            


                        


                                                                      
                                                  
                           


                                                
{ lib
, aiohttp
, buildPythonPackage
, fetchFromGitHub
, freezegun
, oauthlib
, pytest-asyncio
, pytest-mock
, pytestCheckHook
, pythonOlder
, requests
, requests_oauthlib
, requests-mock
, setuptools-scm
}:

buildPythonPackage rec {
  pname = "pyatmo";
  version = "6.2.4";
  format = "setuptools";

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "jabesq";
    repo = "pyatmo";
    rev = "v${version}";
    sha256 = "sha256-VXkQByaNA02fwBO2yuf7w1ZF/oJwd/h21de1EQlCu2U=";
  };

  SETUPTOOLS_SCM_PRETEND_VERSION = version;

  nativeBuildInputs = [
    setuptools-scm
  ];

  propagatedBuildInputs = [
    aiohttp
    oauthlib
    requests
    requests_oauthlib
  ];

  checkInputs = [
    freezegun
    pytest-asyncio
    pytest-mock
    pytestCheckHook
    requests-mock
  ];

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace "oauthlib~=3.1" "oauthlib" \
      --replace "requests~=2.24" "requests"
  '';

  pythonImportsCheck = [
    "pyatmo"
  ];

  meta = with lib; {
    description = "Simple API to access Netatmo weather station data";
    homepage = "https://github.com/jabesq/pyatmo";
    license = licenses.mit;
    maintainers = with maintainers; [ delroth ];
  };
}