From f29117ff9a9aa3d7268cb4126b573cf836336ca7 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Wed, 11 Jun 2025 10:28:34 -0700 Subject: [PATCH] s3ql: 5.2.3 -> 5.3.0 Changelog: https://github.com/s3ql/s3ql/releases/tag/s3ql-5.3.0 We patch out all the discovery logic in the build script now. --- .../0001-setup.py-remove-self-reference.patch | 68 +++++++++++++++++++ pkgs/by-name/s3/s3ql/package.nix | 52 ++++++++++---- 2 files changed, 108 insertions(+), 12 deletions(-) create mode 100644 pkgs/by-name/s3/s3ql/0001-setup.py-remove-self-reference.patch diff --git a/pkgs/by-name/s3/s3ql/0001-setup.py-remove-self-reference.patch b/pkgs/by-name/s3/s3ql/0001-setup.py-remove-self-reference.patch new file mode 100644 index 000000000000..6abe6c966bc9 --- /dev/null +++ b/pkgs/by-name/s3/s3ql/0001-setup.py-remove-self-reference.patch @@ -0,0 +1,68 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Philip Taron +Date: Wed, 11 Jun 2025 10:41:42 -0700 +Subject: [PATCH] setup.py: remove self-reference and DEVELOPER_MODE + +Signed-off-by: Philip Taron +--- + setup.py | 33 ++------------------------------- + 1 file changed, 2 insertions(+), 31 deletions(-) + +diff --git a/setup.py b/setup.py +index 00f6e9b120525d63fbc17949b2804785f1286118..b5582bcc366148d9c0a442abade65a6127ef2d3c 100755 +--- a/setup.py ++++ b/setup.py +@@ -26,15 +26,7 @@ from setuptools.command.test import test as TestCommand + + faulthandler.enable() + +-basedir = os.path.abspath(os.path.dirname(sys.argv[0])) +-DEVELOPER_MODE = os.path.exists(os.path.join(basedir, 'MANIFEST.in')) +-if DEVELOPER_MODE: +- print('MANIFEST.in exists, running in developer mode') +- +-# Add S3QL sources +-sys.path.insert(0, os.path.join(basedir, 'src')) +-sys.path.insert(0, os.path.join(basedir, 'util')) +-import s3ql ++basedir = "/build/source" + + + class pytest(TestCommand): +@@ -52,27 +44,6 @@ def main(): + + compile_args = ['-Wall', '-Wextra', '-Wconversion', '-Wsign-compare'] + +- # Enable all fatal warnings only when compiling from Mercurial tip. +- # (otherwise we break forward compatibility because compilation with newer +- # compiler may fail if additional warnings are added) +- if DEVELOPER_MODE: +- if os.environ.get('CI') != 'true': +- compile_args.append('-Werror') +- +- # Value-changing conversions should always be explicit. +- compile_args.append('-Werror=conversion') +- +- # Note that (i > -1) is false if i is unsigned (-1 will be converted to +- # a large positive value). We certainly don't want to do this by +- # accident. +- compile_args.append('-Werror=sign-compare') +- +- # These warnings have always been harmless, and have always been due to +- # issues in Cython code rather than S3QL. Cython itself warns if there +- # are unused variables in .pyx code. +- compile_args.append('-Wno-unused-parameter') +- compile_args.append('-Wno-unused-function') +- + required_pkgs = [ + 'apsw >= 3.42.0', # https://github.com/rogerbinns/apsw/issues/459 + 'cryptography', +@@ -88,7 +59,7 @@ def main(): + setuptools.setup( + name='s3ql', + zip_safe=False, +- version=s3ql.VERSION, ++ version="@version@", + description='a full-featured file system for online data storage', + long_description=long_desc, + author='Nikolaus Rath', diff --git a/pkgs/by-name/s3/s3ql/package.nix b/pkgs/by-name/s3/s3ql/package.nix index 386baa6f4bb3..048b61fecb25 100644 --- a/pkgs/by-name/s3/s3ql/package.nix +++ b/pkgs/by-name/s3/s3ql/package.nix @@ -2,28 +2,56 @@ lib, fetchFromGitHub, python3, + replaceVars, sqlite, which, nix-update-script, + writableTmpDirAsHomeHook, }: -python3.pkgs.buildPythonApplication rec { +let + inherit (python3.pkgs) + buildPythonApplication + setuptools + cython + apsw + cryptography + defusedxml + google-auth + google-auth-oauthlib + pyfuse3 + requests + trio + pytest-trio + pytestCheckHook + python + ; +in + +buildPythonApplication rec { pname = "s3ql"; - version = "5.2.3"; + version = "5.3.0"; pyproject = true; src = fetchFromGitHub { owner = "s3ql"; repo = "s3ql"; tag = "s3ql-${version}"; - hash = "sha256-hNqKLpJd0vj96Jx4YnqYsPLq/iTbvmtvjyLrYozaxpk="; + hash = "sha256-SVB+VB508hGXvdHZo5lt09yssjjwHS1tsDU8M4j+swc="; }; - build-system = with python3.pkgs; [ setuptools ]; + patches = [ + (replaceVars ./0001-setup.py-remove-self-reference.patch { inherit version; }) + ]; - nativeBuildInputs = [ which ] ++ (with python3.pkgs; [ cython ]); + build-system = [ setuptools ]; - propagatedBuildInputs = with python3.pkgs; [ + nativeBuildInputs = [ + which + cython + ]; + + dependencies = [ apsw cryptography defusedxml @@ -35,23 +63,23 @@ python3.pkgs.buildPythonApplication rec { trio ]; - nativeCheckInputs = with python3.pkgs; [ + nativeCheckInputs = [ pytest-trio pytestCheckHook + writableTmpDirAsHomeHook ]; preBuild = '' - ${python3.pkgs.python.pythonOnBuildForHost.interpreter} ./setup.py build_cython build_ext --inplace - ''; - - preCheck = '' - export HOME=$(mktemp -d) + ${python.pythonOnBuildForHost.interpreter} ./setup.py build_cython build_ext --inplace ''; pythonImportsCheck = [ "s3ql" ]; pytestFlagsArray = [ "tests/" ]; + # SSL EOF error doesn't match connection reset error. Seems fine. + disabledTests = [ "test_aborted_write2" ]; + passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex"