<div dir="ltr">On Fri, Jul 19, 2013 at 6:35 AM, Pawel Jasinski <span dir="ltr"><<a href="mailto:pawel.jasinski@gmail.com" target="_blank">pawel.jasinski@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">hi<br>
<br>
I wonder if anybody already made an equivalent of a module with c#<br>
extension, analog to c extension in cpython.<br>
What I am looking for is:<br>
- a way to structure a package<br>
- a way to distribute a package (mods to distutil?)<br>
- how can it coexist with c based extension in the same package<br>
- should it come as c# source only or with .dll<br>
- where to put dlls on the target system. For now I have dropped .dll<br>
into package folder, but I suspect this is not optimal.<br>
<br>
Ideally a package would have a c and c# extension and on both targets<br>
installs with distutils.<br>
<br>
Any comments are greatly appreciated.<br></blockquote><div><br></div><div>I have a couple of older examples (<a href="https://bitbucket.org/jdhardy/ironpythonzlib/src">https://bitbucket.org/jdhardy/ironpythonzlib/src</a> and <a href="https://bitbucket.org/jdhardy/ironpython.sqlite/src">https://bitbucket.org/jdhardy/ironpython.sqlite/src</a>) that show how to structure them. You could also look at the source for IronPython.Modules.</div>
<div><br></div><div>Whether you can replace a C module depends on how the existing C module works; Python supports a couple of different uses. Which package are you trying to support?</div><div><br></div><div>If you want distutils to build them, you'll need to extend distutils. Once nice thing is that .NET/Mono always has a C# compiler available, so that's totally feasible.</div>
<div><br></div><div>For modules shipped with IronPython they go in the DLLs folder, but that might not work in all cases.</div><div><br></div><div>In general, they're pretty easy to write, but no one has yet explored how to fit them into the Python packaging ecosystem.</div>
<div><br></div><div>- Jeff</div></div></div></div>