summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/aiopvpc/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/aiopvpc/default.nix')
-rw-r--r--pkgs/development/python-modules/aiopvpc/default.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/aiopvpc/default.nix b/pkgs/development/python-modules/aiopvpc/default.nix
new file mode 100644
index 000000000000..489ca5d6f6fb
--- /dev/null
+++ b/pkgs/development/python-modules/aiopvpc/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, aiohttp
+, async-timeout
+, buildPythonPackage
+, fetchFromGitHub
+, fetchpatch
+, poetry-core
+, pytest-asyncio
+, pytest-timeout
+, pytestCheckHook
+, pythonOlder
+, pytz
+}:
+
+buildPythonPackage rec {
+ pname = "aiopvpc";
+ version = "2.0.2";
+ disabled = pythonOlder "3.7";
+ format = "pyproject";
+
+ src = fetchFromGitHub {
+ owner = "azogue";
+ repo = pname;
+ rev = "v${version}";
+ sha256 = "1ajs4kbdlfn4h7f3d6lwkp4yl1rl7zyvj997nhsz93jjwxbajkpv";
+ };
+
+ nativeBuildInputs = [
+ poetry-core
+ ];
+
+ propagatedBuildInputs = [
+ aiohttp
+ pytz
+ async-timeout
+ ];
+
+ checkInputs = [
+ pytest-asyncio
+ pytest-timeout
+ pytestCheckHook
+ ];
+
+ patches = [
+ # Switch to poetry-core, https://github.com/azogue/aiopvpc/pull/10
+ (fetchpatch {
+ name = "use-peotry-core.patch";
+ url = "https://github.com/azogue/aiopvpc/commit/4bc2740ffd485a60acf579b4f3eb5ee6a353245c.patch";
+ sha256 = "0ynj7pqq3akdvdrvqcwnnslay3mn1q92qhk8fg95ppflzscixli6";
+ })
+ ];
+
+ postPatch = ''
+ substituteInPlace pytest.ini --replace \
+ " --cov --cov-report term --cov-report html" ""
+ '';
+
+ pythonImportsCheck = [ "aiopvpc" ];
+
+ meta = with lib; {
+ description = "Python module to download Spanish electricity hourly prices (PVPC)";
+ homepage = "https://github.com/azogue/aiopvpc";
+ license = with licenses; [ mit ];
+ maintainers = with maintainers; [ fab ];
+ };
+}