JuliaPy / Conda.jl

Conda managing Julia binary dependencies
Other
173 stars 57 forks source link

Recreating environments #132

Closed rofinn closed 5 years ago

rofinn commented 5 years ago

Added Conda.freeze and Conda.create functions for re-creating environments.

NOTE: I would have done Conda.export if export wasn't already a keyword, but freeze (e.g., pip freeze) seemed like the next best thing.

StefanKarpinski commented 5 years ago

@stevengj, would you mind taking a look at this?

stevengj commented 5 years ago

Maybe we should use similar terminology to Pkg3, where the analogous thing is called a "manifest". e.g. Conda.manifest_export(f, ...) and Conda.manifest_import(f, ...).

For the f argument, it would be nice to support either a filename or an arbitrary ::IO object. This is certainly possible for export. For import I guess you'd have to write a temporary file first.

rofinn commented 5 years ago

Maybe we should use similar terminology to Pkg3, where this is called a "manifest". e.g. Conda.manifest_export(f, ...) and Conda.manifest_import(f, ...).

I think I'd prefer to keep the terminology between python & julia package management separate to avoid confusion (I don't believe the files are referred to as manifests anywhere in the python documentation).

For the f argument, it would be nice to support either a filename or an arbitrary ::IO object. This is certainly possible for export. For import I guess you'd have to write a temporary file first.

That's true, but I'm not sure what the use case would be. Are you thinking in case someone wants to codify the requirements in a julia string or something?

stevengj commented 5 years ago

Yes. In general, in Julia wherever you can pass a filename you can also pass an IO object.

stevengj commented 5 years ago

Whatever we call it, I think the names for import and export should echo one another: foo_import and foo_export or similar. And the term "manifest" is pretty common in many packaging systems.

I don't like the term freeze since "freezing" the package system could also be interpreted as locking it to prevent changes.

rofinn commented 5 years ago

Hmmm, if julia had native filepath types then freeze could just be a list method. I suppose a compromise could be:

export_list(filepath, env=ROOTENV)

Given that this covers the conda command that's actually being called.

stevengj commented 5 years ago

(needs a rebase/merge)

stevengj commented 5 years ago

appveyor failure?

rofinn commented 5 years ago

I'm not sure why appveyor failed on 1.0 and nightly. Seems like conda threw an error trying to install curl?

stevengj commented 5 years ago

There is an error:

      File "C:\Users\appveyor\.julia\conda\3\lib\site-packages\conda\models\records.py", line 102, in box
        val = tuple(f for f in (ff.strip() for ff in val) if f)
    TypeError: 'NoneType' object is not iterable

that doesn't look like a network problem?

stevengj commented 5 years ago

I restarted AppVeyor just in case it was a transient error.

stevengj commented 5 years ago

Passing now, so must have been a temporary network glitch.

rofinn commented 5 years ago

Thanks!