V0.0.3 Nodejs support.
This commit is contained in:
parent
9c4c35fdd6
commit
54f494163a
17 changed files with 1871 additions and 484 deletions
|
|
@ -1,6 +1,6 @@
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; pypi.scm
|
||||
;; Copyright (C) 2025 Cor Legemaat <cor@cor.za.net>
|
||||
;; Copyright (C) 2025, 2026 Cor Legemaat <cor@cor.za.net>
|
||||
;;
|
||||
;; This file is part of ebuild-autogen: you can redistribute it and/or modify it
|
||||
;; under the terms of the GNU Affero General Public License as published by the
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
(define-module (ebuild fetchers pypi)
|
||||
#:use-module (ebuild defs)
|
||||
#:use-module (ebuild fetchers raw)
|
||||
#:use-module (ebuild semver)
|
||||
#:use-module (ebuild utils)
|
||||
#:use-module (curl)
|
||||
#:use-module (json)
|
||||
|
|
@ -61,28 +62,32 @@
|
|||
(let* ((data (fetch-pypi-pkg pypi-name display-data))
|
||||
(versions (vector->list (assoc-ref data "versions")))
|
||||
(files (assoc-ref data "files")))
|
||||
(map (lambda (version)
|
||||
(let ((upload-date (car ((dql (select (filter (where (lambda (file-name)
|
||||
(if (string? file-name)
|
||||
(string-contains file-name
|
||||
(string-append "-"
|
||||
version
|
||||
(car file-types)))
|
||||
#f))
|
||||
"filename"))
|
||||
(parm-as "date" "upload-time")))
|
||||
files))))
|
||||
(filter-map
|
||||
(lambda (version)
|
||||
(if (semver->irregex-match version)
|
||||
(let ((upload-date ((dql (select (filter (where (lambda (file-name)
|
||||
(if (string? file-name)
|
||||
(string-contains file-name
|
||||
(string-append "-"
|
||||
version
|
||||
(car file-types)))
|
||||
#f))
|
||||
"filename"))
|
||||
(parm-as "date" "upload-time")))
|
||||
files)))
|
||||
(if (nil? upload-date)
|
||||
(if (>= (assoc-ref parms 'verbosity)
|
||||
verbosity-error)
|
||||
(begin (display "Upload file \"")
|
||||
(display (string-append "-"
|
||||
version
|
||||
(car file-types)))
|
||||
(display "\" not found, skipping release!")
|
||||
(newline)))
|
||||
(begin (if (>= (assoc-ref parms 'verbosity)
|
||||
verbosity-error)
|
||||
(begin (display "Upload file for version \"")
|
||||
(display version)
|
||||
(display "\" and type \"")
|
||||
(display (car file-types))
|
||||
(display "\" not found, skipping release!")
|
||||
(newline)))
|
||||
#f)
|
||||
(list (cons "version" version)
|
||||
(car upload-date)
|
||||
(cons "version-values" (semver->comps version))
|
||||
(car (car upload-date))
|
||||
(cons "assets"
|
||||
(map (lambda (type)
|
||||
(append (car ((dql (select (filter (where (lambda (file-name)
|
||||
|
|
@ -98,5 +103,6 @@
|
|||
(parm "hashes" "sha256")))
|
||||
files))
|
||||
(list (cons "type" type))))
|
||||
file-types))))))
|
||||
file-types)))))
|
||||
#f))
|
||||
versions))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue