kgashok / shedskin

Automatically exported from code.google.com/p/shedskin
0 stars 0 forks source link

Create shedskin package for laterly easier import/install #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Creation of a shedskin package:

The setup.py was modified to create a execuable 'shedskin.py', that can be
symlinced to anywhere where needed. On later installs the executable will
be smaler, because the sys.path.append won't be needed at all.

Don't know what 'backward.py' and 'bert.py' are about... Can they be
ignored/deleted? They are looking like tests…

Original issue reported on code.google.com by thomas.s...@gmail.com on 6 Sep 2009 at 4:01

Attachments:

GoogleCodeExporter commented 9 years ago
Forgot to add:

docstrings are missing to make it a 'perfect' package ;)

Original comment by thomas.s...@gmail.com on 6 Sep 2009 at 9:15

GoogleCodeExporter commented 9 years ago
thanks! ;) I committed the patch, with a few small changes, and renamed ss.py to
__init__.py. please let me know if anything I changed seems wrong to you..

I moved bert.py to testdata/, since it's only used in the tests, and removed
backward.py, because it was only needed when using Python 2.3, which is not 
supported
anymore. thanks for noting! 

I really don't like to add .py to the 'shedskin' startup script, but I guess you
added this because it otherwise conflicts with the new 'shedskin' dir.. I'm now
thinking about writing a distutils setup.py, or would you be interested in 
adding that?

Original comment by mark.duf...@gmail.com on 7 Sep 2009 at 6:36

GoogleCodeExporter commented 9 years ago
hm.. no time to investigate further, but the following now results in an error:

srepmub@akemi:~/shedskin/examples$ shedskin go
*** SHED SKIN Python-to-C++ Compiler 0.2 ***
Copyright 2005-2009 Mark Dufour; License GNU GPL version 3 (See LICENSE)

*ERROR* go.py:None: cannot locate module: builtin

(shedskin is a symlink in /usr/bin to shedskin.py)

Original comment by mark.duf...@gmail.com on 7 Sep 2009 at 6:47

GoogleCodeExporter commented 9 years ago
Yeha, the patch from remove SHEDSKIN ROOT is wrong... :(

Here is another now correctly one ;)

Your changes are ok. I don't have yet much experience in creating packages. If 
you
believe this is the best method (moving ss.py into __init__.py...), it's ok ;)

Does extmod.py belongs in the shedskin package too? It should, but I'm not 
sure^^

Original comment by thomas.s...@gmail.com on 7 Sep 2009 at 11:33

Attachments:

GoogleCodeExporter commented 9 years ago
Wouldn't it better to have just usage() and main() in __init__.py?

This patch moves generate_code to cpp.py (as suggested in TODO). What about 
analysis
and annotate?
I'd prefer to get it out of __init__ ;)

About annotation:
This is more useful for us, than for 'just' users of ss.
Second patch makes annotaion = False as std and shedskin -a or shedskin -ann 
enables
annotaion.

Ah, forgot to add in "now_properly_remove_SHEDSKIN_ROOT.patch":
in unit.py instead import ss[…] import shedskin[…]

Original comment by thomas.s...@gmail.com on 8 Sep 2009 at 6:05

Attachments:

GoogleCodeExporter commented 9 years ago
thanks! I committed the new SHEDSKIN ROOT patch, but avoiding the 'shedskin' 
import
and magic constant of 22. let's find out what happens with this under windows 
later..

and you are right, I forgot to move extmod.py as well. 

will look at the other patches later today.

Original comment by mark.duf...@gmail.com on 9 Sep 2009 at 12:08

GoogleCodeExporter commented 9 years ago
how about so? :)

you are right this is much better!

about annotation: I think this can also be useful for regular users, as it can
sometimes make it easier for them to understand some strange piece of code. but 
I
agree this is not typical usage, so the default should be 'off'. 

thanks for all the help!

Original comment by mark.duf...@gmail.com on 9 Sep 2009 at 12:58

GoogleCodeExporter commented 9 years ago
You are welcome ;)

Hmm, how to install this later on? Where is lib with all .cpp and .hpp living?

With shedskin module installed in site-packages lib has to be there, too (with
current configuration).

So make it complicated and install them as header files in /usr/include or make 
it
simple and also move lib into the shedskin package. But what happens then 
inside of
the package? Means, then it's possible to call a "import shedskin.lib" or 
something
from outside?

I'm a bit confused atm :-D

Original comment by thomas.s...@gmail.com on 9 Sep 2009 at 1:32

GoogleCodeExporter commented 9 years ago
I'm guessing distutils does this kind of thing in a standardized way.. maybe 
you'd
like to have a look at creating a distutils setup.py?

Original comment by mark.duf...@gmail.com on 9 Sep 2009 at 3:37

GoogleCodeExporter commented 9 years ago
Could be, but how to determin the libdir from shared itself? If distutils 
installs it
where it wants to, we need to search at least at 2 places for the dir…

Original comment by thomas.s...@gmail.com on 9 Sep 2009 at 3:56

GoogleCodeExporter commented 9 years ago
my guess is you can just ask distutils this?

Original comment by mark.duf...@gmail.com on 9 Sep 2009 at 4:00

GoogleCodeExporter commented 9 years ago
If you wanted an easy distutils way of locating the bundled files, you could 
put the
lib directory inside the package and then specify it in the package_data 
parameter of
the distutils setup function in the setup.py script. Then, after installation, 
the
lib directory would reside inside shedskin in site-packages and you could 
generate
the necessary -I flags dynamically (for the Makefile) by asking for the lib
subdirectory of shedskin.__file__.

I'm not sure how compatible this is with Debian guidelines, for example, but I 
do
similar things with some of my own packages. Generally, distutils is quite 
deficient
in dealing with the wider filesystem, but this is the least worst solution.

Original comment by p...@boddie.org.uk on 24 Sep 2009 at 11:45

GoogleCodeExporter commented 9 years ago

Original comment by mark.duf...@gmail.com on 18 Mar 2010 at 7:57