mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
import: pypi: Do not parse optional requirements from source.
* guix/import/pypi.scm: Export PARSE-REQUIRES.TXT. (clean-requirement): Move procedure to the top level. (guess-requirements): Move the READ-REQUIREMENTS procedure to the top level, and rename it to PARSE-REQUIRES.TXT. Move the CLEAN-REQUIREMENT procedure to the top level. Move the COMMENT? functions inside the PARSE-REQUIRES.TXT procedure. (parse-requires.txt): Add a SECTION-HEADER? predicate, and use it to prevent parsing optional requirements. * tests/pypi.scm (test-requires-with-sections): New variable. ("parse-requires.txt, with sections"): New test.
This commit is contained in:
parent
a853acebe1
commit
c4797121be
2 changed files with 58 additions and 30 deletions
|
@ -62,6 +62,14 @@ bar
|
|||
baz > 13.37
|
||||
")
|
||||
|
||||
(define test-requires-with-sections "\
|
||||
foo ~= 3
|
||||
bar != 2
|
||||
|
||||
[test]
|
||||
pytest (>=2.5.0)
|
||||
")
|
||||
|
||||
(define test-metadata
|
||||
"{
|
||||
\"run_requires\": [
|
||||
|
@ -101,6 +109,12 @@ baz > 13.37
|
|||
(uri (list "https://bitheap.org/cram/cram-0.7.tar.gz"
|
||||
(pypi-uri "cram" "0.7"))))))))
|
||||
|
||||
(test-equal "parse-requires.txt, with sections"
|
||||
'("foo" "bar")
|
||||
(mock ((ice-9 ports) call-with-input-file
|
||||
call-with-input-string)
|
||||
(parse-requires.txt test-requires-with-sections)))
|
||||
|
||||
(test-assert "pypi->guix-package"
|
||||
;; Replace network resources with sample data.
|
||||
(mock ((guix import utils) url-fetch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue