Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Failure to byte-compile nupic/regions/UnimportableNode.py during install #898

Closed
oxtopus opened this issue Apr 30, 2014 · 3 comments · Fixed by #1190
Closed

Failure to byte-compile nupic/regions/UnimportableNode.py during install #898

oxtopus opened this issue Apr 30, 2014 · 3 comments · Fixed by #1190

Comments

@oxtopus
Copy link
Contributor

oxtopus commented Apr 30, 2014

Not technically a bug, since it affects an unmerged feature (see #880 and #809). However, it will eventually need to be adressed, so I'm adding this issue for now.

There exists a python module that explicitly contains a syntax error. When the nupic package is bundled up and the .pyc files generated, this error is reported:

...
byte-compiling /tmp/nupic-darwin64/Library/Python/2.7/site-packages/nupic/regions/TestRegion.py to TestRegion.pyc
byte-compiling /tmp/nupic-darwin64/Library/Python/2.7/site-packages/nupic/regions/TPRegion.py to TPRegion.pyc
byte-compiling /tmp/nupic-darwin64/Library/Python/2.7/site-packages/nupic/regions/UnimportableNode.py to UnimportableNode.pyc
  File "/Library/Python/2.7/site-packages/nupic/regions/UnimportableNode.py", line 5
    Try to import this, Python interpreter...
         ^
SyntaxError: invalid syntax

byte-compiling /tmp/nupic-darwin64/Library/Python/2.7/site-packages/nupic/research/__init__.py to __init__.pyc
byte-compiling /tmp/nupic-darwin64/Library/Python/2.7/site-packages/nupic/research/anomalyzer.py to anomalyzer.pyc
...

We maybe need to re-evaluate the utility of this and move it elsewhere (or remove it entirely).

@rhyolight rhyolight added this to the Sprint 28 milestone Aug 4, 2014
@rhyolight rhyolight assigned rhyolight and unassigned rhyolight Aug 4, 2014
@rhyolight
Copy link
Member

This is bugging the hell out of me.

@pgavazzi
Copy link
Contributor

pgavazzi commented Aug 5, 2014

as per http://stackoverflow.com/questions/2230843/how-can-i-detect-errors-programatically-when-building-an-egg-with-setuptools

disutils does not stop on syntax errors, just prints them. If you look at the solution it shows you how to wrap py.compile(), you could just put a try: except: around the py.compile() and silently ignore SyntaxErrors, you could do it also for only a list of IGNORED_FILES.

Let me know if you need help to do this.

@rhyolight
Copy link
Member

Thanks, @pgavazzi! That's useful information.

Let me know if you need help to do this.

I would be more than happy if you worked on this. I will assign it to you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants