From patchwork Sun May 28 21:21:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jelle Licht X-Patchwork-Id: 50400 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 68A9927BBEA; Sun, 28 May 2023 22:23:28 +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,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 99E1027BBE2 for ; Sun, 28 May 2023 22:23:24 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3Nr4-0003iB-LK; Sun, 28 May 2023 17:23:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3Nr2-0003hr-DH for guix-patches@gnu.org; Sun, 28 May 2023 17:23:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3Nr2-0003uW-5B for guix-patches@gnu.org; Sun, 28 May 2023 17:23:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3Nqw-0002tM-Mq; Sun, 28 May 2023 17:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35598] [PATCH v2] gnu: Add python-mesa. References: <20190506030507.5469-1-pritchard.calvin@gmail.com> In-Reply-To: <20190506030507.5469-1-pritchard.calvin@gmail.com> Resent-From: jlicht@fsfe.org Original-Sender: "Debbugs-submit" Resent-CC: lars@6xq.net, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Sun, 28 May 2023 21:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35598 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35598@debbugs.gnu.org Cc: Calvin Pritchard , Jelle Licht , Lars-Dominik Braun , jgart X-Debbugs-Original-Xcc: Lars-Dominik Braun , jgart Received: via spool by 35598-submit@debbugs.gnu.org id=B35598.168530897211082 (code B ref 35598); Sun, 28 May 2023 21:23:02 +0000 Received: (at 35598) by debbugs.gnu.org; 28 May 2023 21:22:52 +0000 Received: from localhost ([127.0.0.1]:54742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3NqY-0002sS-9x for submit@debbugs.gnu.org; Sun, 28 May 2023 17:22:52 -0400 Received: from mail1.fsfe.org ([217.69.89.151]:52576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3NqV-0002sH-U3 for 35598@debbugs.gnu.org; Sun, 28 May 2023 17:22:37 -0400 From: jlicht@fsfe.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fsfe.org; s=2021100501; t=1685308952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Ei3CieKs+UtTPkr6LIWMR1IyU51QQzsKZ2SL1zuQbkE=; b=BDvppyDay2pAwac8c6y1js2EG8W5854oeKl42ugirQNcoWP6cLngMAzmVgVLOz8uoRCthe 8d4gssfaMtuT28IFiyyaOIiHQeKOQveG6IH5fSuUwav14cQ9smgMDJ5LXTdeK973/D6l5z cLwphL8xEWUs89O+WvuA+dLbOSnx6Xc= Date: Sun, 28 May 2023 23:21:02 +0200 Message-Id: MIME-Version: 1.0 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Calvin Pritchard * gnu/packages/python-xyz.scm (python-mesa). New variable. Co-authored-by: Jelle Licht --- Changes in v2: - Drop all dependency patches, as those packages now exist - Use pyproject-build-system - Reworked to modern packaging standards - Update mesage package version to 1.2.1. gnu/packages/python-xyz.scm | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) base-commit: 9845e408e533f5834a13f294ca1ddc1dc7e248fd diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index f7e3f6f538..be89df2fa1 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -2305,6 +2305,69 @@ (define-public python-license-expression conventions and aliases in the same expression.") (license license:gpl2+))) +(define-public python-mesa + (package + (name "python-mesa") + (version "1.2.1") + (source (origin + (method url-fetch) + (uri (pypi-uri "Mesa" version)) + (sha256 + (base32 + "01504d2bgfwsg92942k34fi7adq5n9r1fw4sn5kx0sm70jwq1628")))) + (build-system pyproject-build-system) + (arguments + (list + #:modules '((guix build pyproject-build-system) + (guix build utils) + (ice-9 match) + (srfi srfi-1)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-cookiecutter + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "mesa/main.py" + (("\"cookiecutter\"") + (string-append "\"" + (search-input-file inputs "/bin/cookiecutter") + "\""))))) + (add-after 'build 'set-HOME + ;; Some tests write to $HOME. + (lambda _ (setenv "HOME" "/tmp"))) + (replace 'compile-bytecode + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((site-dir (site-packages inputs outputs)) + (python (assoc-ref inputs "python")) + (major-minor (map string->number + (take (string-split (python-version python) + #\.) + 2))) + (<3.7? (match major-minor + ((major minor) + (or (< major 3) + (and (= major 3) + (< minor 7))))))) + (unless <3.7? + ;; The cookiecutter-mesa directory contains project templates that + ;; should not be compiled. + (invoke "python" "-m" "compileall" + "-x" "cookiecutter-mesa" + "--invalidation-mode=unchecked-hash" site-dir)))))))) + (propagated-inputs (list python-click + python-networkx + python-numpy + python-pandas + python-tornado + python-tqdm)) + (inputs (list python-cookiecutter)) + (native-inputs (list python-coverage python-pytest python-pytest-cov)) + (home-page "https://github.com/projectmesa/mesa") + (synopsis "Agent-based modeling (ABM) in Python") + (description "Mesa is an agent-based modeling framework in Python. It contains +core components to implement spatial models, schedule agents and visualize model +runs.") + (license license:asl2.0))) + (define-public python-wand (package (name "python-wand")