summaryrefslogtreecommitdiff
path: root/tests/import
AgeCommit message (Collapse)AuthorFilesLines
9 daysimport/utils: Allow `find-version' to match an over-specified version.Maxim Cournoyer1-0/+25
This fixes the use case of using --target-version with an exact match (--target-version causes the partial? mode to be enabled). * tests/import/utils.scm ("find-version, latest") ("find-version, empty versions list") ("find-version, partial, under-specified") ("find-version, partial, exact") ("find-version, partial, over-specified"): New tests. * guix/import/utils.scm (find-version): [PARTIAL?]: Truncate VERSION to the maximum length of VERSIONS. Explicitly handle the empty versions case.
2026-08-10tests: Update reference to deprecated package.Andreas Enge1-1/+1
* tests/import/elm.scm (test-group): Replace font-adobe-source-sans-pro by font-adobe-source-sans. * gnu/packages/tex.scm (texlive-sourcesanspro): Change comment.
2026-05-26tests: import: gem: Add test for mixed valid and gibberish licenses.Phillip Davis1-0/+14
Verifies that when only one of multiple license strings is recognized, the resulting list has the correct license followed by one instance of the symbol 'unknown-license! * tests/import/gem.scm (test-mixed-licenses-json): New fixture. ("gem->guix-package with mixed valid and gibberish licenses"): New test. Change-Id: I33a003d50ba20d30360b52c448ae28ad9d37233b Merges: https://codeberg.org/guix/guix/pulls/8276 Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au> Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-05-26tests: import: gem: Add test for unrecognized license identifiers.Phillip Davis1-0/+13
Exercises the map in 4f78d33f0 where every license string is unrecognized, so the resulting package should have (license (list unknown-license! unknown-license!)). * tests/import/gem.scm (test-gibberish-licenses-json): New fixture. ("gem->guix-package with gibberish license identifiers"): New test. Change-Id: I85cbb0574f9393749a84f4cf5818d4c1083a8476 Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au> Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-05-26import: gem: Use spdx-string->license for license lookup.Phillip Davis1-0/+94
Similar to what was done for the crate importer in 263a267b75. * guix/import/gem.scm (string->license): Try spdx-string->license first, returning symbols instead of license objects. Fall back to the existing hardcoded table for non-SPDX strings. (make-gem-sexp): Remove license->symbol calls; licenses are now symbols directly. * tests/import/gem.scm (test-spdx-json): New fixture. ("gem->guix-package with SPDX license identifiers"): New test. Change-Id: I5fa0ebdfd3a3393eab5ef0554ed09887a89bc107 Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au> Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-05-26import: gem: Fix null at home-page.Phillip Davis1-0/+40
The RubyGems API returns "homepage_uri": null for gems with no homepage. guile-json parses JSON null as the Guile symbol 'null', which passes through into the generated package sexp as (home-page null)—an unbound variable error at evaluation time. * tests/import/gem.scm (test-no-homepage-json): New fixture. ("gem->guix-package, bald homepage_uri"): New test. * guix/import/gem.scm (non-empty-string-or-false): New procedure. (<gem>)[home-page]: Use it. * guix/import/utils.scm (non-empty-string-or-false): New exported procedure, moved to here... * guix/import/gem.scm (non-empty-string-or-false): ...from here... * guix/import/pypi.scm (non-empty-string-or-false): ...and here. Change-Id: If8f2ca32834d762c753797067ef87937503ff9f9 Reviewed-by: Carlo Zancanaro <carlo@zancanaro.id.au> Signed-off-by: Nguyễn Gia Phong <cnx@loang.net>
2026-05-24guix: build-system: Set pypi-uri in pyproject, drop python module.Nicolas Graves1-1/+0
After this commit, when both modules are imported: - if pyproject is imported before, the warning is 'pypi-uri' is deprecated, use '(@ (guix build-system pyproject) pypi-uri)' instead - if python is imported before, the warning is `pypi-uri' imported from both (guix build-system python) and (guix build-system pyproject) This seems convenient enough to warn for deprecation in the short term, while avoiding any breaking changes. * guix/build-system/pyproject.scm (pypi-uri): Move the procedure from (guix build-system python) here. * guix/build-system/python (pypi-uri): Drop definition, import it from (guix build-system pyproject) and deprecate it. * gnu/packages/openldap.scm: Reorder modules to get the right warning. * gnu/packages/pypy.scm: Likewise. * gnu/packages/*.scm : Drop module (guix build-system python). * tests/import/pypi.scm: Likewise. Merges: https://codeberg.org/guix/guix/pulls/7448 Change-Id: Ib42f53bc545052eb7918a25afe9db6d5fc2cb834 Reviewed-by: Nguyễn Gia Phong <cnx@loang.net> Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-05-24tests: pypi: Switch to pyproject-build-system.Nicolas Graves1-1/+2
* tests/import/pypi.scm ("package-latest-release"): Switch to pyproject-build-system. Change-Id: I8ba5cdd45e793cd2aae7b3025f7598245de6c87e Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-03-10style: git-source: Handle more URLs.Ludovic Courtès1-0/+9
* guix/import/utils.scm (tarball-url->git-repository-url): New procedure. * guix/scripts/style.scm (url-fetch->git-fetch)[transform-source]: Add ‘repository-url’ parameter. Use ‘tarball-url->git-repository-url’ when ‘home-page’ is not a Git URL. (transform-to-git-fetch): Rename ‘home-page’ to ‘repository-url’. * tests/import/utils.scm ("tarball-url->git-repository-url, guile"): New test. * tests/style.scm ("url-fetch->git-fetch, mirror:// URL"): New test. Change-Id: I4f8ca7c67a58f917d69380678b62c00962b0f9cd Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2026-03-08guix: import: cpan: Fill in description field in template.jgart1-1/+1
* guix/import/cpan.scm (cpan-module->sexp): Fill in description field in template. * tests/import/cpan.scm (test-source): Update test to account for change in description text. Change-Id: I3bc3e4c2cc90f7a1f1f0d56e9213b6a1d0b8e841 Signed-off-by: jgart <jgart@dismail.de>
2026-03-07import/cran: Fix import of packages in single quotes.Ricardo Wurmus1-1/+6
* guix/import/cran.scm (import-pattern): Also match on single quotes. (needed-vignettes-inputs-in-directory): Use EXTRACT-IMPORTS. * tests/import/cran.scm: Add test. Change-Id: Ie69027992519bd8d886860346f4a359514d8e822
2026-02-07import: pypi: Fix tests.Nicolas Graves1-13/+11
* guix/import/pypi.scm (unzip-command): Use invoke instead of system*. (read-wheel-metadata): Adapt accordingly. (guess-requirements-from-wheel): Improve readability. * tests/import/pypi.scm (parse-wheel-metadata): Add test (used to isolate the issue in another test). (pypi->guix-package, no wheel): Remove python-wheel from the result. (pypi->guix-package, no usable requirement file, no wheel.): Likewise. (pypi->guix-package, package name contains \"-\" followed by digits): Likewise. (package-latest-release): Likewise. (pypi->guix-package, no requires.txt, but wheel): Likewise. Also improve readability. Change-Id: I49e6ae549437a068acd85fa0f13471bc0af5a399 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-02-07import: pypi: Ignore pypi-ignored-inputs.Nicolas Graves1-1/+2
* guix/import/pypi.scm (pypi-ignored-inputs): New variable. (compute-inputs): Use it. * tests/pypi.scm (parse-requires.txt): Add ignored input to test the feature. * guix/lint.scm (check-inputs-should-be-native): Adapt list. (check-inputs-should-not-be-an-input-at-all): Use pypi-ignored-list. Change-Id: I297793b71f9ffdfbe7cc4e883777f8823941adf0 Modified-by: Sharlatan Hellseher <sharlatanus@gmail.com> Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2026-01-19import: nuget: Add tests and documentation.Danny Milosavljevic1-0/+270
* guix/import/nuget.scm: Prevent optimizing small functions away completely. * tests/import/nuget.scm: New file. * doc/guix.texi (nuget): Document it. * Makefile.am (SCM_TESTS): Add reference to it. Fixes: guix/guix#5483 Change-Id: Id58932fe404a11a03e61a91d3b6177b39548f1bc
2026-01-18import: crate: Generate comments with ‘TODO REVIEW:’ prefix.Hilton Chain1-3/+1
This distinguishes them from manually added ones. When committing changes, these ‘TODO REVIEW’ comments should be addressed and removed first. If you're working with Rust packaging, please update your local Guix to this commit to apply the change. * guix/import/crate.scm (cargo-lock->expressions): Generate comments with ‘TODO REVIEW:’ prefix. * tests/import/crate.scm ("crate-lockfile-import"): Don't check the exact comment string. * doc/guix-cookbook.texi (Common Workflow for Rust Packaging), * gnu/packages/rust-crates.scm: Adjust accordingly. Change-Id: I76b914b49be46d04cc61b101b6bc9e31cadb7f07 Signed-off-by: Rutherther <rutherther@ditigal.xyz> Merges: #4567
2025-12-13tests: Use ‘https’ for ‘home-page’ in ‘guix import pypi’ tests.Ludovic Courtès1-6/+6
Fixes a regression introduced in d66e9698a18a6be2d6b670f5a31c23f87afece68. * tests/import/pypi.scm ("pypi->guix-package, no wheel") ("pypi->guix-package, no wheel, no requires.txt, but pyproject.toml") ("pypi->guix-package, no wheel, but requires.txt and pyproject.toml") ("pypi->guix-package, no requires.txt, but wheel.") ("pypi->guix-package, no usable requirement file, no wheel.") ("pypi->guix-package, package name contains \"-\" followed by digits"): Change ‘home-page’ to ‘https://’. Fixes: guix/guix#4646 Reported-by: Rutherther <rutherther@ditigal.xyz> Change-Id: Id3ddac832d9688f2eb8a055c13f62a9642a20766
2025-11-29import/cran: Detect library references in "check_installed".Ricardo Wurmus1-0/+5
* guix/import/cran.scm (import-pattern): Add case for "check_installed". * tests/import/cran.scm: Add test. Change-Id: Id69371158eecaeb371056e6954a3109687346c22
2025-11-29import/cran: Reduce false positives in extracting imports.Ricardo Wurmus1-2/+17
* tests/import/cran.scm: Add tests for extract-imports. * guix/import/cran.scm (extract-imports): New procedure, extracted from... (needed-test-inputs-in-directory): ...this procedure, which now uses it. (import-pattern): Update regex pattern. Change-Id: I07ac3f685ff08a0fa7da3c25cf1f63fbca18b95f
2025-11-22gnu: Remove store path occurrences.Rutherther1-2/+3
When running `make dist`, it is checked that there are no store paths in the resulting dist folder. Specifically through the `assert-no-store-file-names` target. I think that this target makes sense and this commit has workarounds for currently embedded store paths. Two of those are comments. Maybe the target could be changed to ignore those in the future. But the hash is not important, so just replace it with <hash>. As for crate tests, I decided to split the string instead of removing it, although it seems to me it might safely be removed, but I am not completely sure about the intent here. * gnu/packages/astronomy.scm (python-jplephem-2.22): Remove store hash from comment. * gnu/packages/golang-build.scm (golang-org-x-exp): Likewise. * tests/import/crate.scm (temp-file): Split store path's hash. Change-Id: I709f29a9dfab626d194c41d12e53e0380a148217 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
2025-10-24import: utils: Add generate-git-source procedure.Nicolas Graves1-0/+42
This procedure tries to generate a <origin> sexp from a single url and version. * guix/import/utils.scm (generate-git-source): Add procedure. * tests/import/utils.scm: Add tests for generate-git-source. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-24import: utils: Fix default-git-error.Nicolas Graves1-0/+24
This function was missing one argument. * guix/import/utils.scm (default-git-error): Add and document location argument. * tests/import/utils.scm: Add tests for default-git-error. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-08import: gem: Move tests to tests/import/gem.scm.Nicolas Graves1-0/+309
Follow-up forgotten in 94df3e6f28e. * tests/gem.scm: Move to tests/import/gem.scm. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: utils: Move tests to tests/import/utils.scm.Nicolas Graves1-0/+281
* tests/utils.scm: Move to tests/import/utils.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: npm-binary: Move tests to tests/import/npm-binary.scm.Nicolas Graves1-0/+165
* tests/npm-binary.scm: Move to tests/import/npm-binary.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: composer: Move tests to tests/import/composer.scm.Nicolas Graves1-0/+88
* tests/composer.scm: Move to tests/import/composer.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: texlive: Move tests to tests/import/texlive.scm.Nicolas Graves1-0/+990
* tests/texlive.scm: Move to tests/import/texlive.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: luanti: Move tests to tests/import/luanti.scm.Nicolas Graves1-0/+501
* tests/luanti.scm: Move to tests/import/luanti.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: github: Move tests to tests/import/github.scm.Nicolas Graves1-0/+148
* tests/import-github.scm: Move to tests/import/github.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: print: Move tests to tests/import/print.scm.Nicolas Graves1-0/+190
* tests/print.scm: Move to tests/import/print.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: hexpm: Move tests to tests/import/hexpm.scm.Nicolas Graves1-0/+253
* tests/hexpm.scm: Move to tests/import/hexpm.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: opam: Move tests to tests/import/opam.scm.Nicolas Graves1-0/+193
* tests/opam.scm: Move to tests/import/opam.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: elpa: Move tests to tests/import/elpa.scm.Nicolas Graves1-0/+135
* tests/elpa.scm: Move to tests/import/elpa.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: cran: Move tests to tests/import/cran.scm.Nicolas Graves1-0/+137
* tests/cran.scm: Move to tests/import/cran.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: git: Move tests to tests/import/git.scm.Nicolas Graves1-0/+240
* tests/import-git.scm: Move to tests/import/git.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: elm: Move tests to tests/import/elm.scm.Nicolas Graves1-0/+266
* tests/elm.scm: Move to tests/import/elm.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: egg: Move tests to tests/import/egg.scm.Nicolas Graves1-0/+120
* tests/egg.scm: Move to tests/import/egg.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: go: Move tests to tests/import/go.scm.Nicolas Graves1-0/+418
* tests/go.scm: Move to tests/import/go.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: crate: Move tests to tests/import/crate.scm.Nicolas Graves1-0/+338
* tests/crate.scm: Move to tests/import/crate.scm. * Makefile.am: Refresh it. * CODEOWNERS: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: cpan: Move tests to tests/import/cpan.scm.Nicolas Graves1-0/+132
* tests/cpan.scm: Move to tests/import/cpan.scm. * gnu/packages/admin.scm (ansible): Update comment. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: hackage: Move tests to tests/import/hackage.scm.Nicolas Graves1-0/+670
* tests/hackage.scm: Move to tests/import/hackage.scm. * Makefile.am: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-10-01import: pypi: Move tests to tests/import/pypi.scmNicolas Graves1-0/+571
* tests/pypi.scm: Move to tests/import/pypi.scm * CODEOWNERS: Refresh it. * Makefile.am: Refresh it. * etc/teams.scm: Refresh it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>