about summary refs log tree commit diff
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2023-11-19 18:41:07 +0200
committerGitHub <noreply@github.com>2023-11-19 18:41:07 +0200
commite33d15e18b3f3068ad7ae4ca86f3da2a3cb25c54 (patch)
treee2fb044be4ae226569c8f9adbdaf088da5785029
parent5e9f00b69933ca169fc232280285abad7e5e3449 (diff)
parent7565e18097c71c0926014c3428827bb9619dfac1 (diff)
Merge pull request #267436 from natsukium/xdg
-rw-r--r--pkgs/development/python-modules/xdg/default.nix26
1 files changed, 17 insertions, 9 deletions
diff --git a/pkgs/development/python-modules/xdg/default.nix b/pkgs/development/python-modules/xdg/default.nix
index f44d2e4435664..065f434bd7ee4 100644
--- a/pkgs/development/python-modules/xdg/default.nix
+++ b/pkgs/development/python-modules/xdg/default.nix
@@ -1,20 +1,23 @@
-{ lib, buildPythonPackage, fetchFromGitHub, isPy27
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pythonOlder
 , clikit
 , poetry-core
-, pytestCheckHook
 }:
 
 buildPythonPackage rec {
   version = "6.0.0";
   pname = "xdg";
-  disabled = isPy27;
+  disabled = pythonOlder "3.7";
   format = "pyproject";
 
-  src = fetchFromGitHub {
-    owner = "srstevenson";
-    repo = pname;
-    rev = "refs/tags/${version}";
-    hash = "sha256-yVuruSKv99IZGNCpY9cKwAe6gJNAWjL+Lol2D1/0hiI=";
+  # the github source uses `xdg_base_dirs`, but pypi's sdist maintains `xdg` for compatibility.
+  # there are actually breaking changes in xdg_base_dirs,
+  # and libraries that want to support python 3.9 and below need to use xdg.
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-JCeAlPLUXoRtHrKKLruS17Z/wMq1JJ7jzojJX2SaHJI=";
   };
 
   nativeBuildInputs = [ poetry-core ];
@@ -23,7 +26,12 @@ buildPythonPackage rec {
     clikit
   ];
 
-  nativeCheckInputs = [ pytestCheckHook ];
+  # sdist has no tests
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "xdg"
+  ];
 
   meta = with lib; {
     description = "XDG Base Directory Specification for Python";