python311Packages.walrus: disable on unsupported Python releases

This commit is contained in:
Fabian Affolter 2023-10-01 11:14:00 +02:00 committed by GitHub
parent 065ac7bec9
commit c890002d68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@
, pkgs , pkgs
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, pythonOlder
, redis , redis
, unittestCheckHook , unittestCheckHook
}: }:
@ -11,10 +12,12 @@ buildPythonPackage rec {
version = "0.9.3"; version = "0.9.3";
format = "setuptools"; format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "coleifer"; owner = "coleifer";
repo = "walrus"; repo = "walrus";
rev = version; rev = "refs/tags/${version}";
hash = "sha256-jinYMGSBAY8HTg92qU/iU5vGIrrDr5SeQG0XjsBVfcc="; hash = "sha256-jinYMGSBAY8HTg92qU/iU5vGIrrDr5SeQG0XjsBVfcc=";
}; };
@ -22,7 +25,9 @@ buildPythonPackage rec {
redis redis
]; ];
nativeCheckInputs = [ unittestCheckHook ]; nativeCheckInputs = [
unittestCheckHook
];
preCheck = '' preCheck = ''
${pkgs.redis}/bin/redis-server & ${pkgs.redis}/bin/redis-server &
@ -33,12 +38,14 @@ buildPythonPackage rec {
kill $REDIS_PID kill $REDIS_PID
''; '';
pythonImportsCheck = [ "walrus" ]; pythonImportsCheck = [
"walrus"
];
meta = with lib; { meta = with lib; {
description = "Lightweight Python utilities for working with Redis"; description = "Lightweight Python utilities for working with Redis";
homepage = "https://github.com/coleifer/walrus"; homepage = "https://github.com/coleifer/walrus";
changelog = "https://github.com/coleifer/walrus/blob/${src.rev}/CHANGELOG.md"; changelog = "https://github.com/coleifer/walrus/blob/${version}/CHANGELOG.md";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ mbalatsko ]; maintainers = with maintainers; [ mbalatsko ];
}; };