Ability to load profiles from Python packages #1227

Open
claytron opened this Issue Jan 4, 2012 · 4 comments

4 participants

@claytron

Currently, there are a lot of dead profiles in IPython.deathrow. In order to facilitate moving these out of the core of ipython, we need a way to load a profile from an external source. This would allow us to distribute a profile as a package and no longer need to depend on ipython updates to get a new release out.

I imagine you could use setuptools entry points to allow for a package to point to a folder that would be used for a particular profile.

@takluyver
IPython member

I was thinking of a way to install an external profile into the correct place, both as a simple Python function, and as a shell command (ipython profile copy /path/to/profile).

But another approach might be for frameworks to provide a standard interface at an importable location so we could do: ipython --pkgprofile zope (which would try to find something like zope.ipy_profile). We probably don't want to depend on setuptools, though.

@fperez
IPython member

A while back we thought about this, and were leaning towards the syntax ipython --profile package:profile as a way of specifying package-provided ipython profiles. And packages would simply carry in their own structure, a subdirectory called 'ipython' containing the necessary profiles (one or more).

One thing that is an issue, though, is that right now our behavior is to auto-copy the profile files on startup to the user's IPYTHON_DIR. We obviously need to create these directories because we write to them, but I'm wondering if we shouldn't continue to resolve the reading of the config files from their original location, unless a copy is explicitly requested. This would make it easier for users to get updates to profiles, which right now won't happen automatically.

I think our current behavior isn't too bad for profiles we provide, since those are mostly empty. But for package-provided profiles, I'm not so sure...

@takluyver
IPython member

I think it makes sense to load config from the package every time, so its easily updatable. But we should probably also offer a simple mechanism to make a local copy of a package profile, so that the user can modify it.

@fperez
IPython member

Fully agreed, @takluyver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment