From e30e8b374e2c9a14360a0eef31eb4807cb9f082e Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 10 Apr 2024 12:02:56 +0200 Subject: [PATCH 1/3] s3ql: refactor - switch to pytestCheckHook - adjust inputs - add pythonImportsCheck - specify license - add changelog - set build system --- pkgs/tools/backup/s3ql/default.nix | 65 +++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/pkgs/tools/backup/s3ql/default.nix b/pkgs/tools/backup/s3ql/default.nix index e2e68109b801..6918528a1fae 100644 --- a/pkgs/tools/backup/s3ql/default.nix +++ b/pkgs/tools/backup/s3ql/default.nix @@ -1,36 +1,71 @@ -{ lib, fetchFromGitHub, python3Packages, sqlite, which }: +{ lib +, fetchFromGitHub +, python3 +, sqlite +, which +}: -python3Packages.buildPythonApplication rec { +python3.pkgs.buildPythonApplication rec { pname = "s3ql"; version = "4.0.0"; + pyproject = true; src = fetchFromGitHub { - owner = pname; - repo = pname; + owner = "s3ql"; + repo = "s3ql"; rev = "refs/tags/release-${version}"; - sha256 = "sha256-7N09b7JwMPliuyv2fEy1gQYaFCMSSvajOBPhNL3DQsg="; + hash = "sha256-7N09b7JwMPliuyv2fEy1gQYaFCMSSvajOBPhNL3DQsg="; }; - nativeCheckInputs = [ which ] ++ (with python3Packages; [ cython pytest pytest-trio ]); - propagatedBuildInputs = with python3Packages; [ - sqlite apsw pycrypto requests defusedxml dugong - google-auth google-auth-oauthlib trio pyfuse3 + build-system = with python3.pkgs; [ + setuptools + ]; + + nativeBuildInputs = [ + which + ] ++ (with python3.pkgs; [ + cython + ]); + + propagatedBuildInputs = with python3.pkgs; [ + apsw + cryptography + defusedxml + dugong + google-auth + google-auth-oauthlib + pyfuse3 + requests + sqlite + trio + ]; + + nativeCheckInputs = with python3.pkgs; [ + pytest-trio + pytestCheckHook ]; preBuild = '' - ${python3Packages.python.pythonOnBuildForHost.interpreter} ./setup.py build_cython build_ext --inplace + ${python3.pkgs.python.pythonOnBuildForHost.interpreter} ./setup.py build_cython build_ext --inplace ''; - checkPhase = '' - # Removing integration tests - rm tests/t{4,5,6}_* - pytest tests + preCheck = '' + export HOME=$(mktemp -d) ''; + pythonImportsCheck = [ + "s3ql" + ]; + + pytestFlagsArray = [ + "tests/" + ]; + meta = with lib; { description = "A full-featured file system for online data storage"; homepage = "https://github.com/s3ql/s3ql/"; - license = licenses.gpl3; + changelog = "https://github.com/s3ql/s3ql/releases/tag/s3ql-${version}"; + license = licenses.gpl3Only; maintainers = with maintainers; [ rushmorem ]; platforms = platforms.linux; }; From 1573d996c9fb19d2e954c7b41670e7bc9fb7524a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 10 Apr 2024 12:05:07 +0200 Subject: [PATCH 2/3] s3ql: format with nixfmt --- pkgs/tools/backup/s3ql/default.nix | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/pkgs/tools/backup/s3ql/default.nix b/pkgs/tools/backup/s3ql/default.nix index 6918528a1fae..4e9fecbbbf1f 100644 --- a/pkgs/tools/backup/s3ql/default.nix +++ b/pkgs/tools/backup/s3ql/default.nix @@ -1,8 +1,9 @@ -{ lib -, fetchFromGitHub -, python3 -, sqlite -, which +{ + lib, + fetchFromGitHub, + python3, + sqlite, + which, }: python3.pkgs.buildPythonApplication rec { @@ -17,15 +18,9 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-7N09b7JwMPliuyv2fEy1gQYaFCMSSvajOBPhNL3DQsg="; }; - build-system = with python3.pkgs; [ - setuptools - ]; + build-system = with python3.pkgs; [ setuptools ]; - nativeBuildInputs = [ - which - ] ++ (with python3.pkgs; [ - cython - ]); + nativeBuildInputs = [ which ] ++ (with python3.pkgs; [ cython ]); propagatedBuildInputs = with python3.pkgs; [ apsw @@ -53,13 +48,9 @@ python3.pkgs.buildPythonApplication rec { export HOME=$(mktemp -d) ''; - pythonImportsCheck = [ - "s3ql" - ]; + pythonImportsCheck = [ "s3ql" ]; - pytestFlagsArray = [ - "tests/" - ]; + pytestFlagsArray = [ "tests/" ]; meta = with lib; { description = "A full-featured file system for online data storage"; From 76fe963e0333b3edb848e400847d799d952b5186 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 10 Apr 2024 12:07:56 +0200 Subject: [PATCH 3/3] s3ql: 4.0.0 -> 5.1.3 Changelog: https://github.com/s3ql/s3ql/releases/tag/s3ql-5.1.3 --- pkgs/tools/backup/s3ql/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/backup/s3ql/default.nix b/pkgs/tools/backup/s3ql/default.nix index 4e9fecbbbf1f..701fccabe4fa 100644 --- a/pkgs/tools/backup/s3ql/default.nix +++ b/pkgs/tools/backup/s3ql/default.nix @@ -8,14 +8,14 @@ python3.pkgs.buildPythonApplication rec { pname = "s3ql"; - version = "4.0.0"; + version = "5.1.3"; pyproject = true; src = fetchFromGitHub { owner = "s3ql"; repo = "s3ql"; - rev = "refs/tags/release-${version}"; - hash = "sha256-7N09b7JwMPliuyv2fEy1gQYaFCMSSvajOBPhNL3DQsg="; + rev = "refs/tags/s3ql-${version}"; + hash = "sha256-8vGW0Kl6hDTY+9mTnm2S659PZ/9gl90d2tXxKIIFimo="; }; build-system = with python3.pkgs; [ setuptools ];