Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py_mini_racer incompatible with pypy #7

Open
Antar1011 opened this issue Aug 9, 2016 · 3 comments
Open

py_mini_racer incompatible with pypy #7

Antar1011 opened this issue Aug 9, 2016 · 3 comments

Comments

@Antar1011
Copy link
Owner

And I'd previously decided to make pypy compatibility a requirement

@Antar1011 Antar1011 added the bug label Aug 9, 2016
@Antar1011
Copy link
Owner Author

Okay, so the alternative topy_mini_racer or js2py is to actually just use node.

As a POC, create a file called blah.js which has the following contents:

console.log('Hello World')

Then from the terminal, with node installed, you can run

$ node blah.js
Hello World

So how this would work is that one would have python download the js to be scraped, prepend exports={}, append console.log(JSON.stringify(exports.BattlePokedex) (or whatever), and then use os.system to run node and capture the output. I'm willing to bet with some research I can figure out how to get node to run piped input instead of needing to execute a file.

Note that conda can install node just as easily as pip can install py_mini_racer. Of course, conda doesn't work with pypy, but as long as my environment in TravisCI has node, this shouldn't be a problem--I'll just need to specify somewhere that node is needed to run Onix.

This was referenced Aug 11, 2016
@Antar1011
Copy link
Owner Author

Fine for now, since we're not worrying about PyPy compatibility

@Antar1011 Antar1011 reopened this Aug 27, 2016
@Antar1011
Copy link
Owner Author

Antar1011 commented Sep 5, 2016

Yeah, building py_mini_racer is nontrivial. Integrating with Travis (see: #40) required that we use a special environment (Ubuntu 14.04 rather than the standard 12.04), and then the only environments I've found where it'll build successfully are 3.5 and 2.7.

That's fine for now, since those are the two environments I'm targeting (and I'm not planning on deploying Onix anywhere that's running an Ubuntu older than 14.04), but this is actually a serious hindrance.

@Antar1011 Antar1011 added tech debt and removed bug labels Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant