make pyjaco

59 views
Skip to first unread message

sltr

unread,
Jul 22, 2012, 3:59:50 PM7/22/12
to pyj...@googlegroups.com
Hi everybody,

i tried to build pyjaco and got this message:

Traceback (most recent call last):
  File "./pyjs.py", line 11, in <module>
    from pyjaco import Compiler
  File "/home/silentrunner/pyjaco/pyjaco/__init__.py", line 40, in <module>
    __version__ = get_version()
  File "/home/silentrunner/pyjaco/_version.py", line 46, in get_version
    raise ValueError('Could not determine version.')
ValueError: Could not determine version.
make: *** [stdlib] Error 1

running debian/wheezy

Thanx in advance

gordon pendleton

unread,
Jul 22, 2012, 4:09:19 PM7/22/12
to pyj...@googlegroups.com

try using setup install

--
You are subscribed to the Google Group pyj...@googlegroups.com
To unsubscribe from this group, send email to
pyjaco+un...@googlegroups.com

sltr

unread,
Jul 23, 2012, 2:12:48 PM7/23/12
to pyj...@googlegroups.com


On Sunday, July 22, 2012 10:09:19 PM UTC+2, g wrote:

try using setup install

raises the same exception

gordon pendleton

unread,
Jul 23, 2012, 2:25:47 PM7/23/12
to pyj...@googlegroups.com
Please provide more information.  Are you using a git repo?  Are you running install from the base directory of the repo?  Can you run python _version.py?  It checks to see if it is in a git repo, otherwise it falls back to reading the VERSION file.

--

gordon pendleton

unread,
Jul 23, 2012, 9:16:25 PM7/23/12
to pyj...@googlegroups.com

try using setup install

raises the same exception



I am running on Windows 7.  I do not have a Debian weezy box to test on.  However I just did the following successfully in a new virtual env.   Please let me know if this works for you.  I am assuming that you are working from a git repo btw.

This is what the directory structure should look like:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
directory structure:
    pyjaco
        src
            pyjaco
                .gitignore
                setup.py
                _version.py
                pyjs.py
                ...
        testing_env
~~~~~~~~~~~~~~~~~~~~~~~~~~~



Here are the commands I used:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
cd "/path/to/pyjaco"
"/path/to/pip" -E testing_env install
"/path/to/pyjaco/testing_env/Scripts/activate.bat"

cd "/path/to/pyjaco/src/pyjaco"
python setup.py install
~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

This was successful for me.  If it fails for you please tell me what branch and commit you are on so I can investigate further.

gordon pendleton

unread,
Jul 23, 2012, 9:17:51 PM7/23/12
to pyj...@googlegroups.com

"/path/to/pyjaco/testing_env/Scripts/activate.bat"


You will have to edit this line.  I missed it when I was adjusting the commands for Linux execution.

sltr

unread,
Jul 24, 2012, 7:02:40 AM7/24/12
to pyj...@googlegroups.com

First of all i have to admit that i'm new to the
git world and i'm not familiar  the virtuel-env.
so i'm not sure if pyjaco is ready for users like me.

So I did everything again according to the readme.rst:

1. git clone https://github.com/chrivers/pyjaco.git

version: 1.3.7+89c4e3c

directory structure looks like this
~~~~~~~~~~~~~~~~~~~~~~~~~~~
directory structure:
    pyjaco
    .gitignore
    setup.py
        _version.py
        pyjs.py
        ...
~~~~~~~~~~~~~~~~~~~~~~~~~~

2. cd pyjacao/
3. su # needed su rights
4. python setup.py install

running install
install_dir /usr/local/lib/python2.6/dist-packages/
Checking .pth file support in /usr/local/lib/python2.6/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.6/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
creating pyjaco.egg-info
writing pyjaco.egg-info/PKG-INFO
writing top-level names to pyjaco.egg-info/top_level.txt
writing dependency_links to pyjaco.egg-info/dependency_links.txt
writing manifest file 'pyjaco.egg-info/SOURCES.txt'
reading manifest file 'pyjaco.egg-info/SOURCES.txt'
writing manifest file 'pyjaco.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-i686/egg
running install_lib
running build_py
creating build
creating build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/pyjaco
copying pyjaco/formater.py -> build/lib.linux-i686-2.6/pyjaco
copying pyjaco/decorator.py -> build/lib.linux-i686-2.6/pyjaco
copying pyjaco/__init__.py -> build/lib.linux-i686-2.6/pyjaco
creating build/lib.linux-i686-2.6/pyjaco/compiler
copying pyjaco/compiler/multiplexer.py -> build/lib.linux-i686-2.6/pyjaco/compiler
copying pyjaco/compiler/javascript.py -> build/lib.linux-i686-2.6/pyjaco/compiler
copying pyjaco/compiler/python.py -> build/lib.linux-i686-2.6/pyjaco/compiler
copying pyjaco/compiler/__init__.py -> build/lib.linux-i686-2.6/pyjaco/compiler
creating build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/25-type-str.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/30-type-int.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/20-type-iter.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/22-type-tuple.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/13-super.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/24-type-dict.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/10-builtin.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/26-type-number.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/70-module-init.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/60-string-format.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/21-type-slice.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/12-exceptions.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/31-type-bool.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/23-type-list.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/11-classes.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/29-type-float.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/05-init.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/06-pyjaco.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/28-type-none.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/14-module.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
copying pyjaco/stdlib/01-strict-mode.js -> build/lib.linux-i686-2.6/pyjaco/stdlib
creating build/bdist.linux-i686
creating build/bdist.linux-i686/egg
creating build/bdist.linux-i686/egg/pyjaco
creating build/bdist.linux-i686/egg/pyjaco/compiler
copying build/lib.linux-i686-2.6/pyjaco/compiler/multiplexer.py -> build/bdist.linux-i686/egg/pyjaco/compiler
copying build/lib.linux-i686-2.6/pyjaco/compiler/javascript.py -> build/bdist.linux-i686/egg/pyjaco/compiler
copying build/lib.linux-i686-2.6/pyjaco/compiler/python.py -> build/bdist.linux-i686/egg/pyjaco/compiler
copying build/lib.linux-i686-2.6/pyjaco/compiler/__init__.py -> build/bdist.linux-i686/egg/pyjaco/compiler
copying build/lib.linux-i686-2.6/pyjaco/formater.py -> build/bdist.linux-i686/egg/pyjaco
copying build/lib.linux-i686-2.6/pyjaco/decorator.py -> build/bdist.linux-i686/egg/pyjaco
copying build/lib.linux-i686-2.6/pyjaco/__init__.py -> build/bdist.linux-i686/egg/pyjaco
creating build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/25-type-str.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/30-type-int.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/20-type-iter.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/22-type-tuple.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/13-super.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/24-type-dict.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/10-builtin.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/26-type-number.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/70-module-init.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/60-string-format.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/21-type-slice.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/12-exceptions.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/31-type-bool.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/23-type-list.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/11-classes.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/29-type-float.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/05-init.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/06-pyjaco.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/28-type-none.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/14-module.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
copying build/lib.linux-i686-2.6/pyjaco/stdlib/01-strict-mode.js -> build/bdist.linux-i686/egg/pyjaco/stdlib
byte-compiling build/bdist.linux-i686/egg/pyjaco/compiler/multiplexer.py to multiplexer.pyc
byte-compiling build/bdist.linux-i686/egg/pyjaco/compiler/javascript.py to javascript.pyc
byte-compiling build/bdist.linux-i686/egg/pyjaco/compiler/python.py to python.pyc
byte-compiling build/bdist.linux-i686/egg/pyjaco/compiler/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-i686/egg/pyjaco/formater.py to formater.pyc
byte-compiling build/bdist.linux-i686/egg/pyjaco/decorator.py to decorator.pyc
byte-compiling build/bdist.linux-i686/egg/pyjaco/__init__.py to __init__.pyc
installing package data to build/bdist.linux-i686/egg
running install_data
copying /home/silentrunner/pyjaco/VERSION -> build/bdist.linux-i686/egg/pyjaco
copying _version.py -> build/bdist.linux-i686/egg/pyjaco
creating build/bdist.linux-i686/egg/EGG-INFO
installing scripts to build/bdist.linux-i686/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-2.6
copying and adjusting pyjs.py -> build/scripts-2.6
changing mode of build/scripts-2.6/pyjs.py from 644 to 755
creating build/bdist.linux-i686/egg/EGG-INFO/scripts
copying build/scripts-2.6/pyjs.py -> build/bdist.linux-i686/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-i686/egg/EGG-INFO/scripts/pyjs.py to 755
copying pyjaco.egg-info/PKG-INFO -> build/bdist.linux-i686/egg/EGG-INFO
copying pyjaco.egg-info/SOURCES.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying pyjaco.egg-info/dependency_links.txt -> build/bdist.linux-i686/egg/EGG-INFO
copying pyjaco.egg-info/top_level.txt -> build/bdist.linux-i686/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
pyjaco.__init__: module MAY be using inspect.getsource
pyjaco.decorator: module MAY be using inspect.getsource
creating dist
creating 'dist/pyjaco-1.3.7_89c4e3c-py2.6.egg' and adding 'build/bdist.linux-i686/egg' to it
removing 'build/bdist.linux-i686/egg' (and everything under it)
Processing pyjaco-1.3.7_89c4e3c-py2.6.egg
creating /usr/local/lib/python2.6/dist-packages/pyjaco-1.3.7_89c4e3c-py2.6.egg
Extracting pyjaco-1.3.7_89c4e3c-py2.6.egg to /usr/local/lib/python2.6/dist-packages
Adding pyjaco 1.3.7-89c4e3c to easy-install.pth file
Installing pyjs.py script to /usr/local/bin

Installed /usr/local/lib/python2.6/dist-packages/pyjaco-1.3.7_89c4e3c-py2.6.egg
Processing dependencies for pyjaco==1.3.7-89c4e3c
Finished processing dependencies for pyjaco==1.3.7-89c4e3c

--
this time everything looks fine, i guess

5. Run example

python examples/gol.py > examples/gol.htm

firefox web-console is givin me this:

[11:11:37.462] ReferenceError: __inherit is not defined @ file:///home/silentrunner/pyjaco/examples/gol.html:16
[11:11:37.468] The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol. @ file:///home/silentrunner/pyjaco/examples/gol.html
[11:11:37.527] ReferenceError: __kwargs_get is not defined @ file:///home/silentrunner/pyjaco/examples/gol.html:8

6. try running tests

needed to install testtools, unittest2

python run_tests.py

Traceback (most recent call last):
  File "run_tests.py", line 7, in <module>
    from unittest import installHandler
ImportError: cannot import name installHandler

unittest does not seem to have installHandler object
but unittest2 ?

sltr

unread,
Jul 24, 2012, 7:04:55 AM7/24/12
to pyj...@googlegroups.com
in the last post i was using debian squeeze 32bit.

sltr

unread,
Jul 24, 2012, 7:06:51 AM7/24/12
to pyj...@googlegroups.com
on wheezy 64 bit

installation works with python setup.py install
not with "make" - same error as to the beginning

1. now i got the examples compiled:

but im not sure if they are correct:

triangulation demo:
seems incomplete but not error in the console

in the line
"JavaScript output "
it shows no output

gol demo:
some dynamic pixels in the canvas
firefox can't handle the demo asks to stop script
chromium does better but very slow

May be you can provide the examples on your website or in the repe
for reference.

2. testing
python run_tests.py

as user:

Looking for "js" and "py-builtins" [2]: /bin/sh: 1: cannot create /tmp/tmp: Permission denied
/bin/sh: 1: js: not found
                      [Error]
Ran 1 test in 0.002s

FAILED (errors=1)

errors:
  (use -x to skip this part)

* Looking for "js" and "py-builtins" [2]:  *

Traceback (most recent call last):
  File "/home/silentrunner/pyjaco/testtools/env_tests.py", line 32, in runTest
    raise RuntimeError("""Can't find the "js" command.""")
RuntimeError: Can't find the "js" command.


as root:

Looking for "js" and "py-builtins" [2]: /bin/sh: 1: js: not found
                      [Error]
Ran 1 test in 0.002s

FAILED (errors=1)

errors:
  (use -x to skip this part)

* Looking for "js" and "py-builtins" [2]:  *

Traceback (most recent call last):
  File "/home/silentrunner/pyjaco/testtools/env_tests.py", line 32, in runTest
    raise RuntimeError("""Can't find the "js" command.""")
RuntimeError: Can't find the "js" command.

looks like some pathes are broken
i guess this errors are due tue not using virtuel-env

gordon pendleton

unread,
Jul 24, 2012, 8:24:02 AM7/24/12
to pyj...@googlegroups.com
On Tue, Jul 24, 2012 at 7:02 AM, sltr <silent...@sonnenkinder.org> wrote:

First of all i have to admit that i'm new to the
git world and i'm not familiar the virtuel-env.
so i'm not sure if pyjaco is ready for users like me.

No problem. Virtualenv isn't a requirement though. It is just handy because it is a "local" python environment not "global". So you can setup different python environments for each project. Keeps you from having conflicting dependencies.  I used the virtual env so it was easy for you to reproduce.

So I did everything again according to the readme.rst:

The readme needs work. I think I will try to update it soon. Everything on it "should" work, but it is dated.


On Tue, Jul 24, 2012 at 7:06 AM, sltr <silent...@sonnenkinder.org> wrote:

May be you can provide the examples on your website or in the repe
for reference.
 
 
Good idea.
 
 
 

2. testing
python run_tests.py

  File "/home/silentrunner/pyjaco/testtools/env_tests.py", line 32, in runTest
    raise RuntimeError("""Can't find the "js" command.""")
RuntimeError: Can't find the "js" command.

looks like some pathes are broken
i guess this errors are due tue not using virtuel-env

 
 
Currently, Pyjaco tests assume that the javascript console is available via the command "js".  I have addressed this issue in my working repo, but I have a few days-ish of work before everything is mergeable.  My merges will also bring support for compiling modules, "import foo" and "from foo import bar".
 
The test runner really needs google's v8 engine console.  See here: http://code.google.com/p/v8/
 
I think there are other consoles that work, but I have only used v8.  My merges also bring QUnit tests for testing in the browser.
 
When you install it symlink the d8 console as "js" somewhere on your path.  Once my changes are merged, you will be able to specify a path to the js console so this will not be an issue.  I am also thinking about supporting other js consoles that use different command flags, but that is a bit of work.
 

Ibot Me

unread,
Jul 24, 2012, 6:51:00 AM7/24/12
to pyj...@googlegroups.com
on wheezy

installation works with python setup.py install
not with "make" same error as the beginning

1. now i got the examples compiled:

but im not sure if they are correct:

triangulation demo:
seems incomplete but no error in the console

in the line
"JavaScript output "
it shows no output

gol demo:
some dynamic pixels in the canvas
firefox can't handle the demo asks to stop script
chromium does better but very slow

May be you can provide the examples compiled on your website or in the
repo for reference.

2. testing
python run_tests.py

as user:

Looking for "js" and "py-builtins" [2]: /bin/sh: 1: cannot create
/tmp/tmp: Permission denied
/bin/sh: 1: js: not found
[Error]
Ran 1 test in 0.002s

FAILED (errors=1)

errors:
(use -x to skip this part)

* Looking for "js" and "py-builtins" [2]: *
Traceback (most recent call last):
File "/home/silentrunner/pyjaco/testtools/env_tests.py", line 32, in
runTest
raise RuntimeError("""Can't find the "js" command.""")
RuntimeError: Can't find the "js" command.


as root:

Looking for "js" and "py-builtins" [2]: /bin/sh: 1: js: not found
[Error]
Ran 1 test in 0.002s

FAILED (errors=1)

errors:
(use -x to skip this part)

* Looking for "js" and "py-builtins" [2]: *
Traceback (most recent call last):
File "/home/silentrunner/pyjaco/testtools/env_tests.py", line 32, in
runTest
raise RuntimeError("""Can't find the "js" command.""")
RuntimeError: Can't find the "js" command.

looks like some paths are broken
i guess this errors are due to not using virtuel-env like u suggested

Ibot Me

unread,
Jul 24, 2012, 6:03:05 AM7/24/12
to pyj...@googlegroups.com
in the last post i was using debian squeeze 32bit.

On 24/07/12 11:49, Ibot Me wrote:
> First of all i have to admit that i'm new to the
> git world and i'm not familiar the virtuel-env.
> so i'm not sure if pyjaco is ready for users like me.
>
> So I did everything again according to the readme.rst:
>
> 1. git clone https://github.com/chrivers/pyjaco.git
>
> version: 1.3.7+89c4e3c
>
> directory structure looks like this
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> directory structure:
> pyjaco
> .gitignore
> setup.py
> _version.py
> pyjs.py
> ...
> Traceback (most recent call last):

Ibot Me

unread,
Jul 24, 2012, 5:49:01 AM7/24/12
to pyj...@googlegroups.com
First of all i have to admit that i'm new to the
git world and i'm not familiar the virtuel-env.
so i'm not sure if pyjaco is ready for users like me.

So I did everything again according to the readme.rst:

1. git clone https://github.com/chrivers/pyjaco.git

version: 1.3.7+89c4e3c

directory structure looks like this
~~~~~~~~~~~~~~~~~~~~~~~~~~~
directory structure:
pyjaco
.gitignore
setup.py
_version.py
pyjs.py
...
Traceback (most recent call last):

sltr

unread,
Jul 26, 2012, 1:09:49 PM7/26/12
to pyj...@googlegroups.com
Thanks for your explanations,

i have another question.

Since it is needed for execute the examples, when is py-builtins.js normaly generated?

On my wheezy installation it is generated during the run_tests.py even though it fails to complete to run the test
because of JS console is missing.
On my squeeze installation it does not get to this point so py-builtins.js is missing.
It is also not generated when running the examples like
python example/gol.py > example/gol.html

Thanks in advance

gordon pendleton

unread,
Jul 26, 2012, 4:14:21 PM7/26/12
to pyj...@googlegroups.com
You can create the builtins using the pyjs.py file.
I am not on my coding machine to verify but it should be something like python pyjs.py --builtins generate
For most purposes, pyjs.py is the file that handles pyjaco usage.
 
If you are going to need import support and are investigating support, you may want to try my repo.  I am working on module and import support.  It is almost wrapped up and ready to be merged back into master. 
 
 
I work in gordon-devel.  To see the module support in action run the test runner with the --as-module flag.  My development branch adds support for QUnit tests and some other handy things.
 
 
 
Reply all
Reply to author
Forward
0 new messages