hy/tests
Kodi Arfer 2b11b9be20 Automatically read and write bytecode
Importing or executing a Hy file now loads the byte-compiled version if it exists and is up to date, and if not, the source is byte-compiled after it's parsed.

This change can speed up Hy a lot. Here are some examples comparing run times of the current master (491b474e) to this commit, on my laptop with Python 3.6:

- `nosetests --exclude='test_bin'` goes from 3.8 s to 0.7 s (a 5-fold speedup)
- `hy -c '(print "hello world")` goes from 0.47 s to 0.20 s (a 2-fold speedup)
- Rogue TV's startup goes from 3.6 s to 0.4 s (a 9-fold speedup)

Accompanying changes include:

- `setup.py` now creates and installs bytecode for `hy.core`, `hy.contrib`, and `hy.extra`.
- The `hyc` command under Python 3 now creates bytecode in `__pycache__`, as usual for Python 3, instead of putting the `.pyc` right next to the source file like Python 2 does.

I've removed a test of `hy.extra.anaphoric.a-if` that triggers #1268 when the test file is byte-compiled and then hits some weird `macroexpand` bug or something when I try to work around that—Nose crashes when trying to produce an error message, and I can't seem to replicate the bug without Nose.
2017-04-14 13:38:33 -07:00
..
compilers Fix bug: quoting a bytestring raises ImportError (#1245) 2017-03-04 19:04:28 -06:00
importer Automatically read and write bytecode 2017-04-14 13:38:33 -07:00
macros Consolidate hy.models.* and tests/models/* into one file apiece 2017-02-16 19:43:00 -08:00
native_tests Automatically read and write bytecode 2017-04-14 13:38:33 -07:00
resources Automatically read and write bytecode 2017-04-14 13:38:33 -07:00
__init__.py Add hy.contrib.hy-repr 2017-03-24 08:43:53 -07:00
test_bin.py Automatically read and write bytecode 2017-04-14 13:38:33 -07:00
test_lex.py Fix a crash when tokenizing a single quote 2017-04-07 21:12:17 +03:00
test_models.py Consolidate hy.models.* and tests/models/* into one file apiece 2017-02-16 19:43:00 -08:00