diff options
| author | Romain GARBAGE <romain.garbage@inria.fr> | 2026-01-26 11:27:50 +0100 |
|---|---|---|
| committer | Romain GARBAGE <romain.garbage@inria.fr> | 2026-02-23 11:37:30 +0100 |
| commit | 5b19b464c7e2fb0ee8d98b6b7d3d7d305b8cb3fc (patch) | |
| tree | 8898d3c5753613ea813018b533574eec2d6fe671 | |
| parent | bc3dba46f0612484cdaebbb2f830d852b31ab0cc (diff) | |
machine-learning: python-tensorstore: Fix missing module error.
* guix-science/packages/machine-learning.scm (python-tensorstore):
Fix missing module error.
| -rw-r--r-- | guix-science/packages/machine-learning.scm | 81 |
1 files changed, 44 insertions, 37 deletions
diff --git a/guix-science/packages/machine-learning.scm b/guix-science/packages/machine-learning.scm index b20d567..c7f7e9b 100644 --- a/guix-science/packages/machine-learning.scm +++ b/guix-science/packages/machine-learning.scm | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #:use-module (gnu packages digest) | 15 | #:use-module (gnu packages digest) |
| 16 | #:use-module (gnu packages docker) | 16 | #:use-module (gnu packages docker) |
| 17 | #:use-module (gnu packages gcc) | 17 | #:use-module (gnu packages gcc) |
| 18 | #:use-module (gnu packages guile) | ||
| 18 | #:use-module (gnu packages image) | 19 | #:use-module (gnu packages image) |
| 19 | #:use-module (gnu packages image-processing) | 20 | #:use-module (gnu packages image-processing) |
| 20 | #:use-module (gnu packages jemalloc) | 21 | #:use-module (gnu packages jemalloc) |
| @@ -1808,43 +1809,49 @@ versions.") | |||
| 1808 | #:vendored-inputs-hash | 1809 | #:vendored-inputs-hash |
| 1809 | "1853pl3ma03qzcg8p775kjlxcq8fr404ljnzj8ykb4nbg5ys5vd0" | 1810 | "1853pl3ma03qzcg8p775kjlxcq8fr404ljnzj8ykb4nbg5ys5vd0" |
| 1810 | #:phases | 1811 | #:phases |
| 1811 | #~(modify-phases (@ (guix-science build bazel-build-system) %standard-phases) | 1812 | ;; pyproject build system requires guile-json but since we are |
| 1812 | (add-after 'unpack 'patch-python-build-system | 1813 | ;; using a build system that is somehow a combination of |
| 1813 | (lambda _ | 1814 | ;; different build systems, phases should be wrapped that |
| 1814 | (substitute* "pyproject.toml" | 1815 | ;; way. See |
| 1815 | (("oldest-supported-numpy") "numpy")) | 1816 | ;; https://codeberg.org/guix-science/guix-science/pulls/462#issuecomment-10172109. |
| 1816 | ;; This rule expects that | 1817 | (with-extensions (list guile-json-4) |
| 1817 | ;; _tensorstore.cpython-310-x86_64-linux-gnu.so exists, | 1818 | #~(modify-phases (@ (guix-science build bazel-build-system) %standard-phases) |
| 1818 | ;; but we've only built _tensorstore.so. | 1819 | (add-after 'unpack 'patch-python-build-system |
| 1819 | (substitute* "setup.py" | 1820 | (lambda _ |
| 1820 | (("os.path.basename\\(ext_full_path\\)") | 1821 | (substitute* "pyproject.toml" |
| 1821 | "'_tensorstore.so'") | 1822 | (("oldest-supported-numpy") "numpy")) |
| 1822 | (("'fallback_version': '0.0.0'") | 1823 | ;; This rule expects that |
| 1823 | (string-append "'fallback_version': '" #$version "'"))) | 1824 | ;; _tensorstore.cpython-310-x86_64-linux-gnu.so exists, |
| 1824 | ;; Make numpy headers available at expected location. See | 1825 | ;; but we've only built _tensorstore.so. |
| 1825 | ;; snippet above for more information. | 1826 | (substitute* "setup.py" |
| 1826 | (let ((python-version #$(version-major+minor | 1827 | (("os.path.basename\\(ext_full_path\\)") |
| 1827 | (package-version | 1828 | "'_tensorstore.so'") |
| 1828 | (this-package-input "python-wrapper"))))) | 1829 | (("'fallback_version': '0.0.0'") |
| 1829 | (copy-recursively | 1830 | (string-append "'fallback_version': '" #$version "'"))) |
| 1830 | (string-append #$(this-package-input "python-numpy") | 1831 | ;; Make numpy headers available at expected location. See |
| 1831 | "/lib/python" | 1832 | ;; snippet above for more information. |
| 1832 | python-version | 1833 | (let ((python-version #$(version-major+minor |
| 1833 | "/site-packages/numpy/core/include/numpy") | 1834 | (package-version |
| 1834 | "/tmp/numpy-include")))) | 1835 | (this-package-input "python-wrapper"))))) |
| 1835 | (add-after 'build 'prepare-python | 1836 | (copy-recursively |
| 1836 | (lambda _ | 1837 | (string-append #$(this-package-input "python-numpy") |
| 1837 | (setenv "TENSORSTORE_PREBUILT_DIR" | 1838 | "/lib/python" |
| 1838 | (string-append (getcwd) | 1839 | python-version |
| 1839 | "/bazel-bin/python/")))) | 1840 | "/site-packages/numpy/core/include/numpy") |
| 1840 | (add-after 'prepare-python 'build-python | 1841 | "/tmp/numpy-include")))) |
| 1841 | (assoc-ref pyproject:%standard-phases 'build)) | 1842 | (add-after 'build 'prepare-python |
| 1842 | (add-after 'build-python 'install-python | 1843 | (lambda _ |
| 1843 | (assoc-ref pyproject:%standard-phases 'install)) | 1844 | (setenv "TENSORSTORE_PREBUILT_DIR" |
| 1844 | (add-after 'install-python 'create-entrypoints | 1845 | (string-append (getcwd) |
| 1845 | (assoc-ref pyproject:%standard-phases 'create-entrypoints)) | 1846 | "/bazel-bin/python/")))) |
| 1846 | (add-after 'create-entrypoints 'compile-bytecode | 1847 | (add-after 'prepare-python 'build-python |
| 1847 | (assoc-ref pyproject:%standard-phases 'compile-bytecode))))) | 1848 | (assoc-ref pyproject:%standard-phases 'build)) |
| 1849 | (add-after 'build-python 'install-python | ||
| 1850 | (assoc-ref pyproject:%standard-phases 'install)) | ||
| 1851 | (add-after 'install-python 'create-entrypoints | ||
| 1852 | (assoc-ref pyproject:%standard-phases 'create-entrypoints)) | ||
| 1853 | (add-after 'create-entrypoints 'compile-bytecode | ||
| 1854 | (assoc-ref pyproject:%standard-phases 'compile-bytecode)))))) | ||
| 1848 | (propagated-inputs | 1855 | (propagated-inputs |
| 1849 | (list python-absl-py | 1856 | (list python-absl-py |
| 1850 | python-appdirs | 1857 | python-appdirs |
