all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jelle Licht <jlicht@fsfe.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Timothy Sample <samplet@ngyro.com>,
	Josselin Poiret <dev@jpoiret.xyz>,
	Simon Tournier <zimon.toutoune@gmail.com>,
	Mathieu Othacehe <othacehe@gnu.org>,
	Tobias Geerinckx-Rice <me@tobias.gr>,
	Lars-Dominik Braun <lars@6xq.net>,
	62375@debbugs.gnu.org, Christopher Baines <guix@cbaines.net>,
	Ricardo Wurmus <rekado@elephly.net>
Subject: [bug#62375] [PATCH v3] import: Add binary npm importer.
Date: Tue, 02 Apr 2024 16:12:01 +0200	[thread overview]
Message-ID: <87r0fng8ge.fsf@fsfe.org> (raw)
In-Reply-To: <871q7odde1.fsf@gnu.org>


Hi Ludo',

Thanks for the speedy review!

Ludovic Courtès <ludo@gnu.org> writes:

> Hi!
>
> jlicht@fsfe.org skribis:
>
>> From: Jelle Licht <jlicht@fsfe.org>
>>
>> * guix/scripts/import.scm: (importers): Add "npm-binary".
>> * guix/import/npm-binary.scm: New file.
>> * guix/scripts/import/npm-binary.scm: New file.
>> * Makefile.am: Add them.
>>
>> Co-authored-by: Timothy Sample <samplet@ngyro.com>
>> Co-authored-by: Lars-Dominik Braun <lars@6xq.net>
>>
>> Change-Id: I98a45068cf5b9c42790664cc743feaa7ac76f807
>
> Yay!
>
>> +The npm-binary importer also allows you to specify a version string:
>> +
>> +@example
>> +guix import npm-binary buffer-crc32 1.0.0
>> +@end example
>
> For consistency with other importers (pypi, gem, cran), could you change
> the syntax to:
>
>   guix import npm-binary buffer-crc32@1.0.0
>
> ?
>
> That’s the last remaining issue for me.
>

I needed some custom logic to support the npm scoped packages
("@linthtml/linthtml@1.2.3"), but it should now work.

>> +;; TODO: Support other registries
>> +(define %registry "https://registry.npmjs.org")
>
> For the purposes of tests, you could make it:
>
>   (define %npm-registry
>     (make-parameter "https://registry.npmjs.org"))

Easy!

> That would allow you to write tests using ‘with-http-server’ and
> ‘parameterize’ as done in ‘tests/pypi.scm’ and others, which I find
> nicer and more robust than ‘mock’.

The `with-http-server' construct does not play well with an interactive
REPL workflow due to not cleaning up the used port in all situations,
making that port unavailable for running the test again[1]. `mock',
brittle as it may be, does not to suffer from this drawback, so I'd
vastly prefer using that for now.

> Not a blocker though.
>
> Thanks!
>
> Ludo’.

I'll send a v4, let it simmer for some days and then merge it if no big
blockers or requested changes show up.

- Jelle




  reply	other threads:[~2024-04-02 14:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22 11:25 [bug#62375] [PATCH 0/1] npm binary importer jlicht
2023-03-22 11:27 ` [bug#62375] [PATCH] import: Add binary npm importer jlicht
2023-03-28 15:49   ` Ludovic Courtès
2023-04-08 18:29     ` Jelle Licht
2023-04-17 21:14       ` [bug#62375] [PATCH 0/1] npm binary importer Ludovic Courtès
2023-06-18 21:03         ` Ludovic Courtès
2023-06-22  9:39           ` Jelle Licht
2024-02-08  0:59 ` Nicolas Graves via Guix-patches via
2024-03-24 14:54 ` [bug#62375] Continue the npm-binary importer Pablo Zamora
2024-03-31 19:57   ` Jelle Licht
2024-03-31 22:03     ` Pablo Zamora
2024-03-31 19:46 ` [bug#62375] [PATCH v2] import: Add binary npm importer jlicht
2024-03-31 20:37 ` [bug#62375] [PATCH v3] " jlicht
2024-04-01 20:41   ` Ludovic Courtès
2024-04-02 14:12     ` Jelle Licht [this message]
2024-04-01 22:01 ` [bug#62375] [PATCH 0/1] npm binary importer Jonathan Brielmaier via Guix-patches via
2024-04-02 14:16   ` Jelle Licht
2024-04-02 14:13 ` [bug#62375] [PATCH v4] import: Add binary npm importer jlicht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r0fng8ge.fsf@fsfe.org \
    --to=jlicht@fsfe.org \
    --cc=62375@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    --cc=guix@cbaines.net \
    --cc=lars@6xq.net \
    --cc=ludo@gnu.org \
    --cc=me@tobias.gr \
    --cc=othacehe@gnu.org \
    --cc=rekado@elephly.net \
    --cc=samplet@ngyro.com \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.