about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pylaunches/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/pylaunches/default.nix')
-rw-r--r--pkgs/development/python-modules/pylaunches/default.nix31
1 files changed, 17 insertions, 14 deletions
diff --git a/pkgs/development/python-modules/pylaunches/default.nix b/pkgs/development/python-modules/pylaunches/default.nix
index f044593ef5587..106ea7a998880 100644
--- a/pkgs/development/python-modules/pylaunches/default.nix
+++ b/pkgs/development/python-modules/pylaunches/default.nix
@@ -4,6 +4,7 @@
   aresponses,
   buildPythonPackage,
   fetchFromGitHub,
+  poetry-core,
   pytestCheckHook,
   pytest-asyncio,
   pythonOlder,
@@ -11,19 +12,27 @@
 
 buildPythonPackage rec {
   pname = "pylaunches";
-  version = "1.4.0";
-  format = "setuptools";
+  version = "2.0.0";
+  pyproject = true;
 
-  disabled = pythonOlder "3.8";
+  disabled = pythonOlder "3.11";
 
   src = fetchFromGitHub {
     owner = "ludeeus";
-    repo = pname;
-    rev = version;
-    sha256 = "sha256-bIcnYcbfAwjet3cg97y+ujFfY2916ANk4sw0sZoU59g=";
+    repo = "pylaunches";
+    rev = "refs/tags/${version}";
+    hash = "sha256-NewzzZuiXwaWU59bu+M2QcSfydL1khvw/YJkbZ58W2Q=";
   };
 
-  propagatedBuildInputs = [ aiohttp ];
+  postPatch = ''
+    # Upstream doesn't set version in the repo
+    substituteInPlace pyproject.toml \
+      --replace-fail 'version = "0"' 'version = "${version}"'
+  '';
+
+  build-system = [ poetry-core ];
+
+  dependencies = [ aiohttp ];
 
   nativeCheckInputs = [
     aresponses
@@ -31,18 +40,12 @@ buildPythonPackage rec {
     pytest-asyncio
   ];
 
-  postPatch = ''
-    # Upstream doesn't set version in the repo
-    substituteInPlace setup.py \
-      --replace 'version="main",' 'version="${version}",' \
-      --replace ', "pytest-runner"' ""
-  '';
-
   pythonImportsCheck = [ "pylaunches" ];
 
   meta = with lib; {
     description = "Python module to get information about upcoming space launches";
     homepage = "https://github.com/ludeeus/pylaunches";
+    changelog = "https://github.com/ludeeus/pylaunches/releases/tag/${version}";
     license = licenses.mit;
     maintainers = with maintainers; [ fab ];
   };