On Friday, March 30, 2012 10:14:15 AM UTC-7, Emil wrote:
>
> Hi, I'm working on a Sage package. I'm new to Sage, and learning as I
> go along...
>
> My source code is a mixture of .py and .spyx files, that (until now) I
> have been attaching() at the sage: prompt. This seems to work quite
> well.
>
> However, I'd like to do things in the "proper" way. So I made a
> directory in SAGE_ROOT/devel/sage/sage/, created __init__.py, all.py,
> and updated the module_list and setup.py files. Then I can build the
> source with sage -b. This works ok as well.
>
> I was wondering, is there a way that I can rebuild the source from the
> sage: prompt, for example using %upgrade? I get the following message
> when I try that:
>
> Delete the following files manually (and rerun %upgrade)
> if you need a full upgrade:
> /Users/ev/.sage/ipython/ipy_user_conf.py
>
> My questions are:
> 1) do people develop sage in this way, or is it more normal to just
> attach() things?
>
You can definitely develop things this way. If, as you say, you're planning 
to have files in the Sage library, you should use .py and .pyx files, but 
perhaps not .spyx files. You need to modify module_list.py and setup.py, as 
you said, and then everything should be fine. You might also consider 
modifying devel/sage/sage/all.py, if you want any of your code to be 
imported by default on startup.

At some point, you should save your work as a Mercurial patch, too. From 
the command line:

  $ sage --hg qnew 'my great patch'
  $ sage --hg qrefresh  # run this whenever you want to update to reflect 
recent changes
  $ sage --hg export tip -o /home/my_account/patches/new_sage_stuff.patch

See the Sage developer's guide and Mercurial documentation for more.

2) is it possible to use %upgrade to rebuild by source from the sage: 
> prompt?
>
I don't know. The standard way to do it is to quit sage and run 'sage -b' 
to rebuild the source, or 'sage -br' to rebuild the source and then run 
Sage.

-- 
John

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to