Changes since 1.1.2:
- Errors in the curl module are less spammy.
- The reup command prints the module as context for errors.
- Use fastentrypoints.py to fix slow startup times in generated scripts.
It doesn't make sense to have two ways to invoke the same module, if we
can avoid it. I'm not aware of anyone relying on `python -m peru.main`
in the wild, but we can revert this if it ends up causing trouble.
This helps recover from "My Python 2&3 got mixed up on Windows!"
in the least surprising way. I'm already used to `py -3 -m pip ...`
but I never thought to check for some longer module-name
to run for peru.
I'm not aware of any downside to having this file.
Please feel free to prove me wrong. :)
Fix#176
Probably only the first of these is needed, because it was
guarding os.makedirs(path) against os.path.exists(path / 'HEAD').
This was causing an error on Windows:
```
C:\dev\dotfiles>peru sync
Traceback (most recent call last):
File "C:\Python36\Scripts\peru-script.py", line 11, in <module>
load_entry_point('peru==1.1.0', 'console_scripts', 'peru')()
File "C:\Python36\lib\site-packages\peru\main.py", line 363, in main
runtime = async.run_task(Runtime(args, env))
File "C:\Python36\lib\site-packages\peru\async.py", line 29, in run_task
return asyncio.get_event_loop().run_until_complete(coro)
File "C:\Python36\lib\asyncio\base_events.py", line 466, in run_until_complete
return future.result()
File "C:\Python36\lib\site-packages\peru\runtime.py", line 20, in Runtime
yield from r._init_cache()
File "C:\Python36\lib\site-packages\peru\runtime.py", line 63, in _init_cache
self.cache = yield from cache.Cache(self.cache_dir)
File "C:\Python36\lib\site-packages\peru\cache.py", line 251, in Cache
yield from cache._init_trees()
File "C:\Python36\lib\site-packages\peru\cache.py", line 270, in _init_trees
os.makedirs(self.trees_path)
File "C:\Python36\lib\os.py", line 220, in makedirs
mkdir(name, mode)
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'C:\\dev\\dotfiles\\.peru\\cache\\trees'
```
Invalid escapes like '\s' used to silently turn into a literal '\s', but
in Python 3.6 they became a deprecation warning, and eventually they'll
be an error.
Changes since 1.0.0:
- Proper error handling. Errors during sync used to kill the entire
process, which spammed the terminal with unfinished coroutine
warnings. Now we catch those errors and print them properly at the
end.
- Cleaned up plugin errors. Common errors like "the network is down" no
longer have stacktraces cluttering them up.