diff options
| author | Efraim Flashner <efraim@flashner.co.il> | 2025-01-21 18:08:18 +0200 |
|---|---|---|
| committer | Efraim Flashner <efraim@flashner.co.il> | 2025-02-05 13:37:00 +0200 |
| commit | fd0e15e5510577233e5925f555c45d182b4c7c22 (patch) | |
| tree | fe8513c65ed39665681760e80bb0e16c3b77fd86 /gnu/packages/python-xyz.scm | |
| parent | c052598835e022f2143b2618a8bfffd5aa0a2ef3 (diff) | |
gnu: python-libcst: Update to 1.6.0.
* gnu/packages/python-xyz.scm (python-libcst): Update to 1.6.0.
[source]: Add snippet to satisfy cargo-build-system.
[build-system]: Switch to cargo-build-system.
[arguments]: Import cargo-build-system, pyproject-build-system modules.
Add cargo-inputs, cargo-development-inputs. Replace 'build, 'install
with the pyproject-build-system phases. Add a phase after 'install for
the extra pyproject phases. Add 2 phases to help build the project.
[native-inputs]: Add python-minimal-wrapper, python-hypothesmith,
python-setuptools-rust, python-setuptools-scm.
[inputs]: Add maturin.
[propagated-inputs]: Remove python-typing-extensions,
python-typing-inspect.
(python-libcst-minimal)[arguments]: Inherit phases from python-libcst
while still skipping the tests.
[native-inputs]: Add python-minimal-wrapper, python-setutools-rust,
python-setuptools-scm.
Change-Id: I7b5ba5404f6e726976af25c0f7db7db2d00bedc5
Diffstat (limited to 'gnu/packages/python-xyz.scm')
| -rw-r--r-- | gnu/packages/python-xyz.scm | 111 |
1 files changed, 86 insertions, 25 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 26a1f3adc30..1c835103af0 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm | |||
| @@ -198,6 +198,7 @@ | |||
| 198 | #:use-module (gnu packages cmake) | 198 | #:use-module (gnu packages cmake) |
| 199 | #:use-module (gnu packages compression) | 199 | #:use-module (gnu packages compression) |
| 200 | #:use-module (gnu packages cpp) | 200 | #:use-module (gnu packages cpp) |
| 201 | #:use-module (gnu packages crates-check) | ||
| 201 | #:use-module (gnu packages crates-io) | 202 | #:use-module (gnu packages crates-io) |
| 202 | #:use-module (gnu packages crates-windows) | 203 | #:use-module (gnu packages crates-windows) |
| 203 | #:use-module (gnu packages crypto) | 204 | #:use-module (gnu packages crypto) |
| @@ -23123,40 +23124,95 @@ some degree most natural languages too.") | |||
| 23123 | (define-public python-libcst | 23124 | (define-public python-libcst |
| 23124 | (package | 23125 | (package |
| 23125 | (name "python-libcst") | 23126 | (name "python-libcst") |
| 23126 | (version "0.3.18") ; starting from 0.4.0 project depends on Rust | 23127 | (version "1.6.0") |
| 23127 | (source (origin | 23128 | (source (origin |
| 23128 | (method url-fetch) | 23129 | (method url-fetch) |
| 23129 | (uri (pypi-uri "libcst" version)) | 23130 | (uri (pypi-uri "libcst" version)) |
| 23130 | (sha256 | 23131 | (sha256 |
| 23131 | (base32 | 23132 | (base32 |
| 23132 | "1ll0yyxbz8zyqcy9kfcqi3l5fah2zqisvpjbzjnz7s7dmb84q59h")))) | 23133 | "1nzhvg52whpmfv8fkrnv7rlrmgc5m43hpyp8ra9kffx47yzcs3p8")) |
| 23133 | (build-system pyproject-build-system) | 23134 | (snippet |
| 23135 | #~(begin (use-modules (guix build utils)) | ||
| 23136 | ;; This is mostly to keep the cargo-build-system happy | ||
| 23137 | (with-output-to-file "Cargo.toml" | ||
| 23138 | (lambda () | ||
| 23139 | (format #t "\ | ||
| 23140 | [workspace] | ||
| 23141 | |||
| 23142 | members = [ | ||
| 23143 | \"native\",]"))))))) | ||
| 23144 | (build-system cargo-build-system) | ||
| 23134 | (arguments | 23145 | (arguments |
| 23135 | (list | 23146 | (list |
| 23136 | #:test-flags | 23147 | #:install-source? #false |
| 23137 | #~(list | 23148 | #:cargo-test-flags |
| 23138 | ;; Reported upstream: <https://github.com/Instagram/LibCST/issues/346>. | 23149 | ;; According to .github/workflows/ci.yml |
| 23139 | "--ignore=libcst/tests/test_fuzz.py" | 23150 | '(list "--manifest-path=native/Cargo.toml" |
| 23140 | ;; Reported upstream: <https://github.com/Instagram/LibCST/issues/347>. | 23151 | "--release" |
| 23141 | "--ignore=libcst/tests/test_pyre_integration.py" | 23152 | "--no-default-features") |
| 23142 | "--ignore=libcst/codemod/tests/test_codemod_cli.py" | 23153 | #:cargo-inputs |
| 23143 | "--ignore=libcst/metadata/tests/test_full_repo_manager.py" | 23154 | (list rust-chic-1 |
| 23144 | "--ignore=libcst/metadata/tests/test_type_inference_provider.py" | 23155 | rust-memchr-2 |
| 23145 | "-k" (string-join | 23156 | rust-paste-1 |
| 23146 | ;; AssertionError: False is not true : libcst.matchers.__init__ | 23157 | rust-peg-0.8 |
| 23147 | ;; needs new codegen! | 23158 | rust-pyo3-0.22 |
| 23148 | (list "not test_codegen_clean_matcher_classes" | 23159 | rust-quote-1 |
| 23149 | "test_codegen_clean_return_types" | 23160 | rust-regex-1 |
| 23150 | "test_codegen_clean_visitor_functions") | 23161 | rust-syn-2 |
| 23151 | " and not ")))) | 23162 | rust-thiserror-1) |
| 23163 | #:cargo-development-inputs | ||
| 23164 | (list rust-criterion-0.5 | ||
| 23165 | rust-difference-2 | ||
| 23166 | rust-itertools-0.13 | ||
| 23167 | rust-rayon-1 | ||
| 23168 | rust-trybuild-1) | ||
| 23169 | #:imported-modules `(,@%pyproject-build-system-modules | ||
| 23170 | ,@%cargo-build-system-modules) | ||
| 23171 | #:modules `((guix build cargo-build-system) | ||
| 23172 | ((guix build pyproject-build-system) #:prefix py:) | ||
| 23173 | (guix build utils)) | ||
| 23174 | #:phases | ||
| 23175 | #~(modify-phases %standard-phases | ||
| 23176 | (add-after 'unpack 'prepare-source | ||
| 23177 | (lambda _ | ||
| 23178 | (delete-file "native/Cargo.lock"))) | ||
| 23179 | (add-after 'configure 'dont-vendor-self | ||
| 23180 | (lambda* (#:key vendor-dir #:allow-other-keys) | ||
| 23181 | ;; Don't keep the whole tarball in the vendor directory | ||
| 23182 | (delete-file-recursively | ||
| 23183 | (string-append vendor-dir "/libcst-" #$version ".tar.zst")))) | ||
| 23184 | (replace 'build | ||
| 23185 | (assoc-ref py:%standard-phases 'build)) | ||
| 23186 | (add-after 'install 'wrap | ||
| 23187 | (lambda _ | ||
| 23188 | ;; Collection of python- and pyproject-build-system phases | ||
| 23189 | ;; between 'install and 'check. | ||
| 23190 | (assoc-ref py:%standard-phases 'add-install-to-pythonpath) | ||
| 23191 | (assoc-ref py:%standard-phases 'add-install-to-path) | ||
| 23192 | (assoc-ref py:%standard-phases 'wrap) | ||
| 23193 | (assoc-ref py:%standard-phases 'create-entrypoints) | ||
| 23194 | (assoc-ref py:%standard-phases 'compile-bytecode))) | ||
| 23195 | ;; We are not the only ones who cannot load libcst.native | ||
| 23196 | ;; during the 'check phase | ||
| 23197 | ;; https://github.com/Instagram/LibCST/issues/1176 | ||
| 23198 | ;(add-after 'wrap 'python-check | ||
| 23199 | ; (lambda args | ||
| 23200 | ; (apply (assoc-ref py:%standard-phases 'check) | ||
| 23201 | ; #:test-flags '() | ||
| 23202 | ; args))) | ||
| 23203 | (replace 'install | ||
| 23204 | (assoc-ref py:%standard-phases 'install))))) | ||
| 23152 | (native-inputs | 23205 | (native-inputs |
| 23153 | (list python-pytest | 23206 | (list python-minimal-wrapper |
| 23207 | python-hypothesmith | ||
| 23208 | python-pytest | ||
| 23154 | python-setuptools | 23209 | python-setuptools |
| 23210 | python-setuptools-rust | ||
| 23211 | python-setuptools-scm | ||
| 23155 | python-wheel)) | 23212 | python-wheel)) |
| 23213 | (inputs (list maturin)) | ||
| 23156 | (propagated-inputs | 23214 | (propagated-inputs |
| 23157 | (list python-typing-extensions | 23215 | (list python-pyyaml)) |
| 23158 | python-typing-inspect | ||
| 23159 | python-pyyaml)) | ||
| 23160 | (home-page "https://github.com/Instagram/LibCST") | 23216 | (home-page "https://github.com/Instagram/LibCST") |
| 23161 | (synopsis "Concrete Syntax Tree (CST) parser and serializer library for Python") | 23217 | (synopsis "Concrete Syntax Tree (CST) parser and serializer library for Python") |
| 23162 | (description | 23218 | (description |
| @@ -23179,9 +23235,14 @@ feels like an AST.") | |||
| 23179 | (package | 23235 | (package |
| 23180 | (inherit python-libcst) | 23236 | (inherit python-libcst) |
| 23181 | (name "python-libcst-minimal") | 23237 | (name "python-libcst-minimal") |
| 23182 | (arguments '(#:tests? #f)) | 23238 | (arguments |
| 23239 | (substitute-keyword-arguments (package-arguments python-libcst) | ||
| 23240 | ((#:tests? _ #t) #f))) | ||
| 23183 | (native-inputs | 23241 | (native-inputs |
| 23184 | (list python-setuptools | 23242 | (list python-minimal-wrapper |
| 23243 | python-setuptools | ||
| 23244 | python-setuptools-rust | ||
| 23245 | python-setuptools-scm | ||
| 23185 | python-wheel))))) | 23246 | python-wheel))))) |
| 23186 | 23247 | ||
| 23187 | (define-public python-typeapi | 23248 | (define-public python-typeapi |
