Re: [IronPython] Exception Model for modules implemented in C#

2011-01-11 Thread Slide
On Tue, Jan 11, 2011 at 10:47 AM, Dino Viehland  wrote:

>  There’s this:
> http://www.mail-archive.com/users@lists.ironpython.com/msg10503.html
>
>
>
> That originally came from the .rst files used to generate docs
> (External.LCA_RESTRICTED\Languages\IronPython\27\Doc\IronPythonDocs) but I
> can’t find it in there now…  I’m not quite sure how that happened.
>
>
>


Sure, use a post that was a response to a question I already asked :-)

Thanks, it was a good refresher on the modules stuff.

slide
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Exception Model for modules implemented in C#

2011-01-11 Thread Slide
On Tue, Jan 11, 2011 at 8:54 AM, Jeff Hardy  wrote:

> On Tue, Jan 11, 2011 at 7:14 AM, Slide  wrote:
> > Is there a document that describes how to implement a Python exception in
> a
> > C# module? In looking through the code, the exception stuff is seemingly
> in
> > about 20 different places and bringing it all together is not easy, at
> least
> > to the casual observer :-)
>
> I don't think there is. It's not too bad once you figure it out, but
> figuring it out is tricky, to say the least.
>
> You could look at
>
> https://bitbucket.org/jdhardy/ironpython.sqlite/src/95894443fffe/src/Exceptions.cs
> ,
> which has it all in one place for a fairly deep exception hierarchy.
> (`InitModuleExceptions` is called from `PerformModuleReload` in
> _sqlite.cs.) I just figured that out from reading the existing
> modules, but I'm thinking I should write a "module implementer's
> guide" with those sorts of lore in it. I thought there was one
> started, but now I can't find it.
>
> - Jeff
> ___
>


That helped a ton, thanks for that! It IS much easier than I was thinking it
had to be. I had been looking at all the exception stuff in the IronPython
sources and some of the stuff that goes on in there is pretty crazy.

Thanks again,

slide
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Adding Unit Tests

2011-01-11 Thread Richard Nienaber
I've got a pull request
waiting that at least
gets the TestRunner to run. It fixes up some bugs and
disables some tests in the configuration file where missing directories
caused it to crash.

Richard

On Tue, Jan 11, 2011 at 5:49 PM, Dino Viehland  wrote:

>
>
> Jeff wrote:
> > On Tue, Jan 11, 2011 at 10:22 AM, Tomas Matousek
> >  wrote:
> > > IronRuby doesn't use the test runner. IronRuby's harness is written in
> Ruby
> > (Languages\Ruby\Tests\Scripts\irtests.rb). It's run by a previous
> IronRuby
> > version checked in to Util\IronRuby.
> >
> > So is there any value whatsoever in keeping the TestRunner around? If
> there
> > isn't, I'll look into porting the IronPython test infrastructure to use
> unittest.
>
> As long as all of the tests we want to run keep running there's no reason
> to keep
> TestRunner - it was just a way to run all of the same tests we ran before
> w/o
> relying upon internal MS infrastructure.
>
> I'm not sure how many of the DLR tests we'll still want to run but I
> imagine we can
> just wrap them in unittest and have it run the EXEs.
>
> ___
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Adding Unit Tests

2011-01-11 Thread Dino Viehland


Jeff wrote:
> On Tue, Jan 11, 2011 at 10:22 AM, Tomas Matousek
>  wrote:
> > IronRuby doesn't use the test runner. IronRuby's harness is written in Ruby
> (Languages\Ruby\Tests\Scripts\irtests.rb). It's run by a previous IronRuby
> version checked in to Util\IronRuby.
> 
> So is there any value whatsoever in keeping the TestRunner around? If there
> isn't, I'll look into porting the IronPython test infrastructure to use 
> unittest.

As long as all of the tests we want to run keep running there's no reason to 
keep
TestRunner - it was just a way to run all of the same tests we ran before w/o
relying upon internal MS infrastructure.

I'm not sure how many of the DLR tests we'll still want to run but I imagine we 
can
just wrap them in unittest and have it run the EXEs.

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Exception Model for modules implemented in C#

2011-01-11 Thread Dino Viehland
There's this: 
http://www.mail-archive.com/users@lists.ironpython.com/msg10503.html

That originally came from the .rst files used to generate docs 
(External.LCA_RESTRICTED\Languages\IronPython\27\Doc\IronPythonDocs) but I 
can't find it in there now...  I'm not quite sure how that happened.


From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Slide
Sent: Tuesday, January 11, 2011 8:05 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Exception Model for modules implemented in C#

Thanks, I think that will help out a lot!

slide

On Tue, Jan 11, 2011 at 8:54 AM, Jeff Hardy 
mailto:jdha...@gmail.com>> wrote:
On Tue, Jan 11, 2011 at 7:14 AM, Slide 
mailto:slide.o@gmail.com>> wrote:
> Is there a document that describes how to implement a Python exception in a
> C# module? In looking through the code, the exception stuff is seemingly in
> about 20 different places and bringing it all together is not easy, at least
> to the casual observer :-)
I don't think there is. It's not too bad once you figure it out, but
figuring it out is tricky, to say the least.

You could look at
https://bitbucket.org/jdhardy/ironpython.sqlite/src/95894443fffe/src/Exceptions.cs,
which has it all in one place for a fairly deep exception hierarchy.
(`InitModuleExceptions` is called from `PerformModuleReload` in
_sqlite.cs.) I just figured that out from reading the existing
modules, but I'm thinking I should write a "module implementer's
guide" with those sorts of lore in it. I thought there was one
started, but now I can't find it.

- Jeff
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



--
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Adding Unit Tests

2011-01-11 Thread Jeff Hardy
On Tue, Jan 11, 2011 at 10:22 AM, Tomas Matousek
 wrote:
> IronRuby doesn't use the test runner. IronRuby's harness is written in Ruby 
> (Languages\Ruby\Tests\Scripts\irtests.rb). It's run by a previous IronRuby 
> version checked in to Util\IronRuby.

So is there any value whatsoever in keeping the TestRunner around? If
there isn't, I'll look into porting the IronPython test infrastructure
to use unittest.

- Jeff
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Adding Unit Tests

2011-01-11 Thread Tomas Matousek
IronRuby doesn't use the test runner. IronRuby's harness is written in Ruby 
(Languages\Ruby\Tests\Scripts\irtests.rb). It's run by a previous IronRuby 
version checked in to Util\IronRuby.

Tomas

-Original Message-
From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Jeff Hardy
Sent: Tuesday, January 11, 2011 8:03 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Adding Unit Tests

On Mon, Jan 10, 2011 at 8:11 PM, Dino Viehland  wrote:
> We don't have to stick to this test runner BTW - it was just an easy 
> way to export what we were running in our internal gated checkin 
> system which we couldn't publish.  We could export the data to 
> something else or we could update it to something more Linux and OS/X 
> friendly (as they probably don't have cmd.exe to run bat files J).

Maybe we should just use unittest2 as the test runner, and wire it into the 
existing one if the IronRuby guys want to keep using it.
Besides, I hear Michael knows a little bit about unittest2, so he might be able 
to help.

- Jeff
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Exception Model for modules implemented in C#

2011-01-11 Thread Slide
Thanks, I think that will help out a lot!

slide

On Tue, Jan 11, 2011 at 8:54 AM, Jeff Hardy  wrote:

> On Tue, Jan 11, 2011 at 7:14 AM, Slide  wrote:
> > Is there a document that describes how to implement a Python exception in
> a
> > C# module? In looking through the code, the exception stuff is seemingly
> in
> > about 20 different places and bringing it all together is not easy, at
> least
> > to the casual observer :-)
>
> I don't think there is. It's not too bad once you figure it out, but
> figuring it out is tricky, to say the least.
>
> You could look at
>
> https://bitbucket.org/jdhardy/ironpython.sqlite/src/95894443fffe/src/Exceptions.cs
> ,
> which has it all in one place for a fairly deep exception hierarchy.
> (`InitModuleExceptions` is called from `PerformModuleReload` in
> _sqlite.cs.) I just figured that out from reading the existing
> modules, but I'm thinking I should write a "module implementer's
> guide" with those sorts of lore in it. I thought there was one
> started, but now I can't find it.
>
> - Jeff
> ___
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>



-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Adding Unit Tests

2011-01-11 Thread Jeff Hardy
On Mon, Jan 10, 2011 at 8:11 PM, Dino Viehland  wrote:
> We don’t have to stick to this test runner BTW – it was just an easy way to
> export what we were running in our internal gated checkin system which we
> couldn’t publish.  We could export the data to something else or we could
> update it to something more Linux and OS/X friendly (as they probably don’t
> have cmd.exe to run bat files J).

Maybe we should just use unittest2 as the test runner, and wire it
into the existing one if the IronRuby guys want to keep using it.
Besides, I hear Michael knows a little bit about unittest2, so he
might be able to help.

- Jeff
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Exception Model for modules implemented in C#

2011-01-11 Thread Jeff Hardy
On Tue, Jan 11, 2011 at 7:14 AM, Slide  wrote:
> Is there a document that describes how to implement a Python exception in a
> C# module? In looking through the code, the exception stuff is seemingly in
> about 20 different places and bringing it all together is not easy, at least
> to the casual observer :-)

I don't think there is. It's not too bad once you figure it out, but
figuring it out is tricky, to say the least.

You could look at
https://bitbucket.org/jdhardy/ironpython.sqlite/src/95894443fffe/src/Exceptions.cs,
which has it all in one place for a fairly deep exception hierarchy.
(`InitModuleExceptions` is called from `PerformModuleReload` in
_sqlite.cs.) I just figured that out from reading the existing
modules, but I'm thinking I should write a "module implementer's
guide" with those sorts of lore in it. I thought there was one
started, but now I can't find it.

- Jeff
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Adding Unit Tests

2011-01-11 Thread Vernon Cole
An interesting thought...
 MY Linux box has a cmd.exe -- it's part of WINE.
But cmd.exe is a very simple shell.  How hard would it be to write one in
Python? IPython (different from IronPython) IS a shell, if I understand
correctly.
--
Vernon

On Mon, Jan 10, 2011 at 8:11 PM, Dino Viehland  wrote:

>  To add a new test you can modify the %DLR_Root%\Test\IronPython.tests
> file and add something like:
>
>
>
> 
>
>   test_csv_cpy
>
>
> %DLR_ROOT%\Languages\IronPython\Internal\ipy.bat
>
>Test\test_csv.py
>
>   60
>
>   false
>
>   false
>
>   false
>
>   false
>
>
> %DLR_ROOT%\External.LCA_RESTRICTED\Languages\IronPython\27\Lib
>
> 
>
>
>
> The test runner will then include running those tests.
>
>
>
> If you want to add new tests beyond what CPython has you could either add
> them directly to CPython’s test_csv.py or you could create a new test_csv.py
> in %DLR_ROOT%\Languages\IronPython\Tests.  If you put them in CPython’s
> test_csv I would suggest adding a comment which says it’s an additional test
> as well as submitting the test back to CPython.  The comment is just there
> so we know what’s going on whenever the next merge from CPython has to
> happen.
>
>
>
> We don’t have to stick to this test runner BTW – it was just an easy way to
> export what we were running in our internal gated checkin system which we
> couldn’t publish.  We could export the data to something else or we could
> update it to something more Linux and OS/X friendly (as they probably don’t
> have cmd.exe to run bat files J).
>
>
>
> *From:* users-boun...@lists.ironpython.com [mailto:
> users-boun...@lists.ironpython.com] *On Behalf Of *Slide
> *Sent:* Monday, January 10, 2011 6:42 PM
> *To:* Discussion of IronPython
> *Subject:* [IronPython] Adding Unit Tests
>
>
>
> As I am developing an implementation of the _csv module that I would
> eventually like to contribute to the community, what is the best way to add
> unit tests to the current suite? I have been using the unit test in the
> CPython sources for the csv module to test my _csv implementation. Is there
> an easy way to incorporate that into the current unit test setup?
>
>
>
> Thanks,
>
>
>
> slide
>
> --
> slide-o-blog
> http://slide-o-blog.blogspot.com/
>
> ___
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Exception Model for modules implemented in C#

2011-01-11 Thread Slide
Is there a document that describes how to implement a Python exception in a
C# module? In looking through the code, the exception stuff is seemingly in
about 20 different places and bringing it all together is not easy, at least
to the casual observer :-)

Thanks,

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Referenced Assemblies with DLR languages

2011-01-11 Thread Doug Blank
Two questions about referenced assemblies (which are really perhaps
DLR questions):

1) I'd like to be able to use different names than are used in a DLL.
For example, say I have a Library.dll, and it has a class
"ReallyBadName". Is there an easy way that I can rename or alias
ReallyBadName after I add a reference to Library? I'd like this to
work for all of my DLR languages, so I'd like to do it right after I
add the reference, rather than, say, doing it in Python with "import
ReallyBadName as GoodName"---but that is the effect I want.

2) Is there a way that I could have a Library.dll bring in other
assemblies so that they would be available to DLR languages? Of
course, one could load an assembly in an assembly that you
clr.AddReference, but that wouldn't make it available to all of the
DLR languages right? It seems that one would need a callback where the
clr was passed into the assembly which was clr.AddReference-ed, so
that it could add references too. Could I overload the clr importer to
do that? Or is there a better way?

Thanks for any pointers,

-Doug
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com