conda / conda-package-streaming

An efficient library to read from new and old format .conda and .tar.bz2 conda packages.
https://conda.github.io/conda-package-streaming/
Other
10 stars 9 forks source link

API for creating `.conda` files on the fly #94

Closed dholth closed 2 months ago

dholth commented 3 months ago

Checklist

What is the idea?

This proposed API yields a TarFile object that is piped through transmute, almost-immediately creating a .conda-format archive. The info/paths.json etc. is up to the user.

I don't think this is all the way there, but it could be a nice way to make conda packages without conda-package-handling. For example we could sha256-hash the files as they went in to help with paths.json and to read the files fewer times.

The same API could be made a bit more efficient by returning a TarFile subclass that delegated .add() to its info- and pkg- archives, but os pipe and threading doesn't seem bad.

dholth commented 3 months ago

Fixed by #90 which gives a TarFile subclass that writes to either itself or the other archive, instead of using threads and pipe.