guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#53019] [PATCH 9/9] gnu: Add python-aerich.


From: Giacomo Leidi
Subject: [bug#53019] [PATCH 9/9] gnu: Add python-aerich.
Date: Mon, 14 Mar 2022 23:36:15 +0100

* gnu/packages/databases.scm (python-aerich): New variable.
---
 gnu/packages/databases.scm | 61 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index e9467a3e79..b3e333bc21 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -56,6 +56,7 @@
 ;;; Copyright © 2021 jgart <jgart@dismail.de>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
+;;; Copyright © 2022 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -118,6 +119,7 @@ (define-module (gnu packages databases)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages networking)
   #:use-module (gnu packages onc-rpc)
+  #:use-module (gnu packages openstack)
   #:use-module (gnu packages pantheon)
   #:use-module (gnu packages parallel)
   #:use-module (gnu packages pcre)
@@ -3015,6 +3017,65 @@ (define-public python-tortoise-orm
 with relational data.")
     (license license:asl2.0)))
 
+(define-public aerich
+  (package
+    (name "aerich")
+    (version "0.6.2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tortoise/aerich";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1bhx37svdln1aramddnpc8572bf81639h6jiyqvskzjkc1lvv60r"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'generate-setup.py
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             ;; FIXME: This is an hack needed to get poetry's setup.py.
+             (setenv "POETRY_VIRTUALENVS_CREATE" "false")
+             (invoke "poetry" "build" "-f" "sdist")
+             (invoke "bash" "-c"
+                     (string-append "tar --wildcards "
+                                    "-xvf dist/*-`poetry version -s`.tar.gz "
+                                    "-O '*/setup.py' > setup.py"))))
+         (replace 'check
+           (lambda* (#:key tests? outputs #:allow-other-keys)
+             (when tests?
+               (let ((out (assoc-ref outputs "out")))
+                 (invoke "pytest" "-vv"))))))))
+    (native-inputs
+     (list
+      poetry
+      python-bandit
+      python-cryptography
+      python-isort
+      python-pytest
+      python-pytest-asyncio
+      python-pytest-mock
+      python-pytest-xdist))
+    (propagated-inputs
+      (list python-asyncmy
+            python-asyncpg
+            python-click
+            python-ddlparse
+            python-dictdiffer
+            python-tomlkit
+            python-tortoise-orm))
+    (home-page "https://github.com/tortoise/aerich";)
+    (synopsis "Database migrations tool for Tortoise ORM (Object Relational
+Mapper)")
+    (description
+      "This package provides @code{aerich}, a Python database migrations tool
+for Tortoise ORM (Object Relational Mapper).  It can be used both
+programmatically or as a standalone CLI application.")
+    (license license:asl2.0)))
+
 (define-public sqlcipher
   (package
     (name "sqlcipher")
-- 
2.34.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]