mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: python-psycopg: Update to 3.2.4.
* gnu/packages/databases.scm (python-psycopg): Update to 3.2.4. [build-system]: Use pyproject-build-system. [arguments]: Simplify phases; restore 'sanity-check. [native-inputs]: Add python-setuptools and python-wheel. Change-Id: Iec2949c7e01e0dff2893181c3a49e8e3a3319446
This commit is contained in:
parent
0ffc5b3afb
commit
0e028beceb
1 changed files with 37 additions and 48 deletions
|
@ -4366,7 +4366,7 @@ with the @code{psycopg} PostgreSQL driver.")
|
||||||
(define-public python-psycopg
|
(define-public python-psycopg
|
||||||
(package
|
(package
|
||||||
(name "python-psycopg")
|
(name "python-psycopg")
|
||||||
(version "3.1.10")
|
(version "3.2.4")
|
||||||
(source (origin
|
(source (origin
|
||||||
;; Fetch from git because PyPI contains only cythonized sources.
|
;; Fetch from git because PyPI contains only cythonized sources.
|
||||||
(method git-fetch)
|
(method git-fetch)
|
||||||
|
@ -4376,54 +4376,41 @@ with the @code{psycopg} PostgreSQL driver.")
|
||||||
(file-name (git-file-name name version))
|
(file-name (git-file-name name version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"0hqk45wlaflz69cy1r0hbv11bwb89p6hjb7zmgqas26gdhg37n0r"))))
|
"0fb83fhaa3saapqv37901hlv017bj40q0dmkxd79aaq442sjf9w2"))))
|
||||||
(build-system python-build-system)
|
(build-system pyproject-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(list #:phases
|
(list
|
||||||
|
#:test-flags
|
||||||
|
'(list "-o" "asyncio_mode=auto"
|
||||||
|
;; FIXME: Many of the typing tests are failing,
|
||||||
|
;; conveniently tagged as slow...
|
||||||
|
"-k" "not slow" "..")
|
||||||
|
#:phases
|
||||||
#~(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
(add-before 'build 'change-directory
|
(add-before 'build 'change-directory
|
||||||
(lambda _
|
(lambda _ (chdir "psycopg")))
|
||||||
(chdir "psycopg")))
|
|
||||||
(add-after 'build 'build-c-extensions
|
(add-after 'build 'build-c-extensions
|
||||||
(lambda _
|
(lambda _
|
||||||
(with-directory-excursion "../psycopg_c"
|
(with-directory-excursion "../psycopg_c"
|
||||||
((assoc-ref %standard-phases 'build)))))
|
((assoc-ref %standard-phases 'build)))))
|
||||||
(add-after 'install 'install-c-extensions
|
(add-after 'install 'install-c-extensions
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
;; For some reason setup.py refuses to install if the
|
|
||||||
;; installation directory is not on PYTHONPATH.
|
|
||||||
(setenv "PYTHONPATH" (site-packages inputs outputs))
|
|
||||||
(with-directory-excursion "../psycopg_c"
|
(with-directory-excursion "../psycopg_c"
|
||||||
((assoc-ref %standard-phases 'install)
|
((assoc-ref %standard-phases 'install)
|
||||||
#:inputs inputs
|
#:inputs inputs #:outputs outputs))))
|
||||||
#:outputs outputs))))
|
|
||||||
(add-before 'check 'start-postgresql
|
(add-before 'check 'start-postgresql
|
||||||
(lambda _
|
(lambda* (#:key inputs tests? #:allow-other-keys)
|
||||||
|
(when tests?
|
||||||
|
(setenv "TZDIR" (search-input-directory inputs
|
||||||
|
"share/zoneinfo"))
|
||||||
(let ((dbdir (string-append (getcwd) "/../pgdir")))
|
(let ((dbdir (string-append (getcwd) "/../pgdir")))
|
||||||
(invoke "initdb" "-D" dbdir)
|
(invoke "initdb" "-D" dbdir)
|
||||||
(invoke "pg_ctl" "-D" dbdir
|
(invoke "pg_ctl" "-D" dbdir
|
||||||
"-o" (string-append "-k " dbdir)
|
"-o" (string-append "-k " dbdir)
|
||||||
"-l" (string-append dbdir "/db.log")
|
"-l" (string-append dbdir "/db.log")
|
||||||
"start")
|
"start")
|
||||||
|
|
||||||
(invoke "psql" "-h" dbdir "-d" "postgres"
|
(invoke "psql" "-h" dbdir "-d" "postgres"
|
||||||
"-c" "CREATE DATABASE nixbld;"))))
|
"-c" "CREATE DATABASE nixbld;"))))))))
|
||||||
(replace 'check
|
|
||||||
(lambda* (#:key inputs tests? #:allow-other-keys)
|
|
||||||
(when tests?
|
|
||||||
(setenv "TZDIR" (search-input-directory inputs
|
|
||||||
"share/zoneinfo"))
|
|
||||||
(with-directory-excursion ".."
|
|
||||||
(invoke "pytest" "-vv"
|
|
||||||
"-o" "asyncio_mode=auto"
|
|
||||||
;; FIXME: Many of the typing tests are failing,
|
|
||||||
;; conveniently tagged as slow...
|
|
||||||
"-k" "not slow")))))
|
|
||||||
;; The sanity check phase attempts loading the C extension
|
|
||||||
;; before the Python library, which results in the following:
|
|
||||||
;; <ImportError: the psycopg package should be imported
|
|
||||||
;; before psycopg_c>.
|
|
||||||
(delete 'sanity-check))))
|
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list python-cython-3
|
(list python-cython-3
|
||||||
python-mypy
|
python-mypy
|
||||||
|
@ -4431,7 +4418,9 @@ with the @code{psycopg} PostgreSQL driver.")
|
||||||
python-pytest
|
python-pytest
|
||||||
python-pytest-asyncio
|
python-pytest-asyncio
|
||||||
python-anyio
|
python-anyio
|
||||||
|
python-setuptools
|
||||||
python-tenacity
|
python-tenacity
|
||||||
|
python-wheel
|
||||||
pproxy
|
pproxy
|
||||||
tzdata-for-tests))
|
tzdata-for-tests))
|
||||||
(inputs
|
(inputs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue