On Fri, Aug 19, 2011 at 6:29 AM, Pedro Cruz <pedrocruzave...@gmail.com> wrote:
>
> I am creating a new package in python separated from Sage tree (following
> [1]) but depends entirely on Sage Math library (and also on Sage Notebook),
> However
>    sage -t somemodule.py
> is not working because of imports. ==> But using this package normally
> causes no problems with imports!

Use "sage -t -force_lib somemodule.py" and be sure to explicitly
import somemodule in your doctests.
This is what I do throughout psage, which is a (now) very large
external library that depends on sage.

http://code.google.com/p/purplesage/

Type  "sage -t -h" to see documentation for the -force_lib option.

 -- William


> I'm following [2] for documenting python sources.
> [1]     http://www.sagemath.org/doc/developer/producing_spkgs.html
> [2]     http://www.sagemath.org/doc/developer/coding_in_python.html
> Maybe "sage -t somemodule.py" is only when coding directly on sage tree. Is
> this the problem?
> Should I put the new package directly on Sage tree using [3] ?
> [3] http://www.sagemath.org/doc/developer/walk_through.html
>
> Any advice?
> Thank you,
> Pedro
>
> During production I have created a link inside
>    ~/sage/local/lib/python2.6/site-packages
> to
>    ~/my_package
> to avoid reinstalling the package everytime.
> To test the package we wrote commands in Rest strings like:
> """
> EXAMPLE:
>    sage: from new_package import MyClass
>    sage: a = MyClass(10) + MyClass(12)
>    MyClass(22)
> """
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to