From patchwork Wed Jul 13 16:50:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luis Felipe X-Patchwork-Id: 40646 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 024C427BBEA; Wed, 13 Jul 2022 17:51:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 12ACE27BBE9 for ; Wed, 13 Jul 2022 17:51:13 +0100 (BST) Received: from localhost ([::1]:54204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oBfZw-000168-7l for patchwork@mira.cbaines.net; Wed, 13 Jul 2022 12:51:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBfZn-00015w-19 for guix-patches@gnu.org; Wed, 13 Jul 2022 12:51:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53722) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oBfZm-0002Oc-5W for guix-patches@gnu.org; Wed, 13 Jul 2022 12:51:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oBfZm-0001IY-3H for guix-patches@gnu.org; Wed, 13 Jul 2022 12:51:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56542] [PATCH] gnu: Add python-django-cleanup. Resent-From: Luis Felipe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 13 Jul 2022 16:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56542 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56542@debbugs.gnu.org X-Debbugs-Original-To: Luis Felipe via Guix-patches Received: via spool by submit@debbugs.gnu.org id=B.16577310434957 (code B ref -1); Wed, 13 Jul 2022 16:51:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Jul 2022 16:50:43 +0000 Received: from localhost ([127.0.0.1]:47619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBfZS-0001Hs-I5 for submit@debbugs.gnu.org; Wed, 13 Jul 2022 12:50:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:41512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBfZQ-0001Hk-CS for submit@debbugs.gnu.org; Wed, 13 Jul 2022 12:50:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47086) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBfZQ-00014T-4t for guix-patches@gnu.org; Wed, 13 Jul 2022 12:50:40 -0400 Received: from mail-4318.protonmail.ch ([185.70.43.18]:20781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oBfZN-0002MT-Nq for guix-patches@gnu.org; Wed, 13 Jul 2022 12:50:39 -0400 Date: Wed, 13 Jul 2022 16:50:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1657731034; x=1657990234; bh=3kICoeIMt6jdGwiFaYoEzFd0vD0Dxl3W9ia514Kw9M8=; h=Date:To:From:Reply-To:Subject:Message-ID:Feedback-ID:From:To:Cc: Date:Subject:Reply-To:Feedback-ID:Message-ID; b=JK0oRegIWLNuR7vco5M3gPHlayijEISZljbQbQfZL01umeK3CMUaJlUlxMkhzm8w+ 0TSd82zcMwt4tNMovtGl8K5cSyJ3tc6wRftIMSTtLqvL5t4KOXGaJEwD+r17xR6lpE zXOo5j+C/z5kqL4hJd5xSA4aMOCQ7ln6F1MqNHfnM5sF0mSxJbXEhgfvoPE9w3gDMu d5B4WJoTYd/mhm09P584QhekNWX/N+H6cG1lKo7kfg3mGUjGUAO8Xn7Koq7V3kKlhQ sEJaV74vS03vFaQrV6q5HRwD6bwyE4P+Iyyx/4FsLYYk//gjgK/7YoMXzaRWmn5Xyv LSSntNfxYiI8g== Message-ID: Feedback-ID: 24022468:user:proton MIME-Version: 1.0 Received-SPF: pass client-ip=185.70.43.18; envelope-from=luis.felipe.la@protonmail.com; helo=mail-4318.protonmail.ch X-Spam_score_int: 9 X-Spam_score: 0.9 X-Spam_bar: / X-Spam_report: (0.9 / 5.0 requ) AC_FROM_MANY_DOTS=2.996, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Luis Felipe X-ACL-Warn: , Luis Felipe via Guix-patches X-Patchwork-Original-From: Luis Felipe via Guix-patches via From: Luis Felipe X-getmail-retrieved-from-mailbox: Patches Hi, a new package here. --- Luis Felipe López Acevedo https://luis-felipe.gitlab.io/ From 16f5e77b90c262e672ac7c32b25911518a4f1743 Mon Sep 17 00:00:00 2001 From: Luis Felipe Date: Wed, 13 Jul 2022 11:23:02 -0500 Subject: [PATCH] gnu: Add python-django-cleanup. * gnu/packages/django.scm (python-django-cleanup): New variable. --- gnu/packages/django.scm | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/gnu/packages/django.scm b/gnu/packages/django.scm index b32faab183..7f2783d071 100644 --- a/gnu/packages/django.scm +++ b/gnu/packages/django.scm @@ -1361,3 +1361,54 @@ (define-public python-django-svg-image-form-field models that use Django's standard @code{ImageField}, in addition to the image files already supported by it.") (license license:expat))) + +(define-public python-django-cleanup + (package + (name "python-django-cleanup") + (version "6.0.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/un1t/django-cleanup") + (commit (string-append version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0c1nghn1bnlq0a4d3sy3s363ksqsnxksixbimdy3cc6a0vk4sjps")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-tests-settings + (lambda* (#:key inputs #:allow-other-keys) + ;; django-cleanup optionally integrates with + ;; sorl-thumbnail, which is not available in Guix yet, so + ;; this patch comments it out to avoid import failures in + ;; test settings. + (substitute* "django_cleanup/testapp/settings.py" + (("'sorl\\.thumbnail',") "# 'sorl.thumbnail',")))) + (replace 'check + (lambda* (#:key tests? inputs outputs #:allow-other-keys) + (when tests? + (add-installed-pythonpath inputs outputs) + ;; Add CWD to PYTHONPATH so that the tests can find the + ;; testapp package in the source. + (setenv "PYTHONPATH" (getcwd)) + (invoke "pytest"))))))) + (native-inputs + (list ;; python-django-sorl-thumbnail ; TODO: Add to Guix. + python-easy-thumbnails + python-pillow + python-pytest + python-pytest-cov + python-pytest-django + python-pytest-xdist)) + (propagated-inputs + (list python-django)) + (home-page "https://github.com/un1t/django-cleanup") + (synopsis "Automatically deletes unused media files") + (description "This application automatically deletes user-uploaded +files when a model is modified or deleted. It works for FileField, +ImageField and their subclasses. Files set as default values for any +FileField are not deleted.") + (license license:expat))) -- 2.36.1