summary refs log tree commit diff
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2023-06-08 23:38:08 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2023-06-08 23:38:08 +0200
commitcbea2db5ee335759c4760091c386f748f922490a (patch)
treed5cee17e1cc2b06fd2828195a405c47d802f0617
parent4c526726994203c7df93723237a31a4ef86903fd (diff)
downloadnixpkgs-cbea2db5ee335759c4760091c386f748f922490a.tar
nixpkgs-cbea2db5ee335759c4760091c386f748f922490a.tar.gz
nixpkgs-cbea2db5ee335759c4760091c386f748f922490a.tar.bz2
nixpkgs-cbea2db5ee335759c4760091c386f748f922490a.tar.lz
nixpkgs-cbea2db5ee335759c4760091c386f748f922490a.tar.xz
nixpkgs-cbea2db5ee335759c4760091c386f748f922490a.tar.zst
nixpkgs-cbea2db5ee335759c4760091c386f748f922490a.zip
python311Packages.python-opensky: init at 0.0.9
-rw-r--r--pkgs/development/python-modules/python-opensky/default.nix63
-rw-r--r--pkgs/top-level/python-packages.nix2
2 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/python-opensky/default.nix b/pkgs/development/python-modules/python-opensky/default.nix
new file mode 100644
index 00000000000..fbce5a40f46
--- /dev/null
+++ b/pkgs/development/python-modules/python-opensky/default.nix
@@ -0,0 +1,63 @@
+{ lib
+, aiohttp
+, aresponses
+, buildPythonPackage
+, fetchFromGitHub
+, poetry-core
+, pydantic
+, pytest-asyncio
+, pytestCheckHook
+, pythonOlder
+, yarl
+}:
+
+buildPythonPackage rec {
+  pname = "python-opensky";
+  version = "0.0.9";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.10";
+
+  src = fetchFromGitHub {
+    owner = "joostlek";
+    repo = "python-opensky";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-Fe0Ra4C4pM1+8ZZFv4yL0RKcUVOZ7Zk78i2ejBmkB/8=";
+  };
+
+  postPatch = ''
+    substituteInPlace pyproject.toml \
+      --replace 'version = "0.0.0"' 'version = "${version}"' \
+      --replace "--cov" ""
+    substituteInPlace src/python_opensky/opensky.py \
+      --replace ".joinpath(uri)" "/ uri"
+  '';
+
+  nativeBuildInputs = [
+    poetry-core
+  ];
+
+  propagatedBuildInputs = [
+    aiohttp
+    pydantic
+    yarl
+  ];
+
+  nativeCheckInputs = [
+    aresponses
+    pytest-asyncio
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [
+    "python_opensky"
+  ];
+
+  meta = with lib; {
+    description = "Asynchronous Python client for the OpenSky API";
+    homepage = "https://github.com/joostlek/python-opensky";
+    changelog = "https://github.com/joostlek/python-opensky/releases/tag/v${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index d24acd32caa..8a731ac208d 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -7819,6 +7819,8 @@ self: super: with self; {
 
   python-openems = callPackage ../development/python-modules/python-openems { };
 
+  python-opensky = callPackage ../development/python-modules/python-opensky { };
+
   python-openzwave-mqtt = callPackage ../development/python-modules/python-openzwave-mqtt { };
 
   python-owasp-zap-v2-4 = callPackage ../development/python-modules/python-owasp-zap-v2-4 { };