CondaPkg.jl icon indicating copy to clipboard operation
CondaPkg.jl copied to clipboard

Equivalent of `pip install -e <path>` for CondaPkg.jl?

Open dingraha opened this issue 2 years ago • 5 comments

One feature I would really like for CondaPkg.jl to have is the ability to add a local version of a Python package, aka the equivalent of pip install -e <path/to/python/package>. Would that be as simple as adding some extra code to _resolve_pip_install: https://github.com/cjdoris/CondaPkg.jl/blob/4d48894b54af4129478153d9f27b1908efe909ca/src/resolve.jl#L288 and maybe an editable attribute to PipPkgSpec: https://github.com/cjdoris/CondaPkg.jl/blob/4d48894b54af4129478153d9f27b1908efe909ca/src/spec.jl#L98? I'd be willing to take a stab at this if you'd be OK with the new feature.

Thanks!

dingraha avatar Jun 12 '23 17:06 dingraha

Do you specifically need an editable install?

You can already install from a local path by setting the version to @./relative/path or @file:///absolute/path.

cjdoris avatar Jun 15 '23 08:06 cjdoris

Gotcha. My hoped-for workflow is to be able to hack on a local Python package in a "Julia-centric" way—running Julia scripts from the Julia REPL that depend on a local Python package that I'm developing. So I think adding an editable Python package would help with that.

With the @./relative/path or @file:///absolute/path approach, would I need to re-install the Python package every time I make a change to that package?

dingraha avatar Jun 15 '23 10:06 dingraha

I see. No, packages using the @ notation are still installed normally (non-editable).

I'd be OK with supporting an editable::Bool entry in PipPkgSpec, with the required changes elsewhere (i.e. parsing deps and resolving).

cjdoris avatar Jun 16 '23 15:06 cjdoris

If we're being really fancy, then we could automatically set editable=true for @ dependencies when the parent package is in dev mode. This might be too magical and slow.

cjdoris avatar Jun 16 '23 15:06 cjdoris

Feel free to take a stab at a PR.

cjdoris avatar Jun 16 '23 15:06 cjdoris