New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove %install_default_config and %install_profiles #1174
Conversation
as they are now controllen with "ipython profile" commands. closes ipython#1174 and Redhad bug #751146 Signed-off-by: Thomas Spura <thomas.spura@gmail.com>
@takluyver, @minrk: if you guys can have a look at this, go for it. I have to finish a talk for work today and will barely make all the last-minute work for the actual release. |
Sure, though I think these were added at your request, so this would remove the (obvious, easy) ability to generate the default config files from IPython. |
Mmhh... I don't recall, but still, it's a good point. The question is: when we added this, did we have any mechanism at all other than manual copying of files and directories? I think we didn't, so a magic seemed like a good solution. Furthermore, I don't think our old system recognized profiles that were kept in the ipython directory, only those that had been made available to the user. Now that users can specify with |
An alternative, if we want to fix this behavior, would be: loc = self.shell.profile_dir.location
cmd = ["ipython", "profile", "create", "--ProfileDir.location=%r" % loc]
if '-o' in s:
cmd += '--reset'
subprocess.call(cmd) And for %install_profiles: if '-o' in s:
overwrite = True
else:
overwrite = False
from IPython.config import profile
profile_dir = os.path.dirname(profile.__file__)
ipython_dir = self.ipython_dir
print "Installing profiles to: %s [overwrite=%s]"%(ipython_dir,overwrite)
for name in os.listdir(profile_dir):
src = os.path.join(profile_dir, name)
files = glob.glob(os.path.join(src, "*.py"))
if files:
print " %s" % name
pd = ProfileDir.create_profile_dir_by_name(ipython_dir, name)
for fname in [ os.path.basename(f) for f in files ]:
pd.copy_config_file(fname, path=src, overwrite=overwrite) If we do remove these magics, we should probably skim the docs for mentions, so we aren't pointing to them anymore. |
On Sun, Dec 18, 2011 at 12:26 PM, Min RK
My only concern with removing them is braking existing habits. Thoughts? |
Pointing to the new profile behavior would be fine too. I'd delete them and point it out in the release notes, so people can find it through your favorite search engine. |
I like the print statement. |
I'd be OK with |
The only advantage I see of It is currently the only easy way we have of seeing what the list of bundled profiles is. But since it would appear that people aren't really using it that way, I don't think anyone would be sad to see it go. |
I should also clarify that viewing the available bundled profiles is the only benefit to |
Shouldn't we then instead just fix
|
Sounds good, see PR #1176 for sample output. |
I like #1176 a lot, so I guess the plan will be to merge this and also 1176, right? |
Yes, I think so. Do we want print-statements on the removed magics, or just remove them? |
Let's do print statements, to help users who might know about them transition more easily. |
Also, searching our docs suggests that we never even mentioned these magics, so there shouldn't be anything to change/update there. |
Great, thanks. Just a quick print statement is enough then. |
@minrk, can you take a shot at this one? I should be done with my talk shortly and will start writing up the release notes and example notebooks. I'd love a hand with this code. |
Sure, should I go ahead and merge with the added print statements, or do a quick PR? |
I'm ok with a merge, but if you prefer to keep the PR workflow, I can look at it too. |
merged |
as they are now controllen with "ipython profile" commands. closes ipython#1174 and Redhad bug #751146 Signed-off-by: Thomas Spura <thomas.spura@gmail.com>
replaces broken %install_profiles and %install_default_config magics with simple print statements. closes ipython#1174
as they are now controllen with "ipython profile" commands.