Commit Graph

596 Commits

Author SHA1 Message Date
Ed Brannin 68350691b6 Remove a now-unnecessary "if os.path.exists()" 2017-03-10 13:17:52 -05:00
Ed Brannin b7b82578be Use contrib.makedirs instead of os.makedirs in cache.py
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'
```
2017-03-10 13:01:14 -05:00
Jack O'Connor 6b7f2fa81d add the Python 3.6 build to Travis 2017-01-31 12:34:59 -05:00
Jack O'Connor fc359fbbb2 clean up an invalid escape sequence
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.
2017-01-31 12:25:27 -05:00
Jack O'Connor 07ee24b9f5 rename async.py to async_helpers.py
Using "async" as a name was deprecated in Python 3.6, and will be an
error in Python 3.7.
2017-01-31 12:19:44 -05:00
Jack O'Connor 9be8463bc3 lint fixes 2017-01-31 12:13:18 -05:00
Jack O'Connor adfbd194f6 clean up the FancyDisplay a bit 2017-01-31 12:10:50 -05:00
Jack O'Connor faf2e348ac bump version to 1.1.0
Changes since 1.0.1:
- Added the `peru module list` command.
- Added --json to that command, and to `peru override list`.
2016-10-28 14:28:42 -04:00
Jack O'Connor 218c177d95 add the --json flag to `peru module list`
Also add some basic tests.
2016-10-28 14:27:41 -04:00
Jack O'Connor 109a6f31a3 fix a lint error 2016-10-07 17:51:15 -04:00
Jack O'Connor 8e6f7d97f9 Merge remote-tracking branch 'origin/module-list' 2016-10-07 17:18:01 -04:00
Kim Spasaro cb6f884935 Not feeling creative 2016-10-03 18:04:33 -05:00
Kim Spasaro af293996c2 changing to use join instead of delimeter concatenation 2016-10-03 17:39:56 -05:00
Kim Spasaro f81936cee0 adding module list command 2016-10-03 17:39:56 -05:00
Sean Olson 20bf6fd117 add --json flag for listing overrides 2016-09-16 21:58:09 -07:00
Jack O'Connor 0e006439f9 bump version to 1.0.1
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.
2016-08-15 10:11:25 -04:00
Jack O'Connor 8e915a8069 update the AUR link to refer to the non-git package 2016-08-05 17:10:33 -04:00
Jack O'Connor 6ad24dbdf0 Merge branch 'coalesce'
Handle errors that occur inside coroutines without aborting other
running jobs or hosing the terminal.
2016-07-30 16:43:22 -04:00
Jack O'Connor e7f2859b47 don't depend on plugins emitting terminating newlines 2016-07-30 16:40:17 -04:00
Jack O'Connor c33f3165a6 delete get_only() 2016-07-30 15:51:24 -04:00
Jack O'Connor 25df5f9ecc delete a TODO 2016-07-30 15:49:29 -04:00
Jack O'Connor e06cc65e60 limit requirements-dev.txt to first order deps 2016-07-30 15:42:24 -04:00
Jack O'Connor c9b76d82a4 get rid of fixed versions for testing tools 2016-07-30 15:39:16 -04:00
Jack O'Connor 5379caf296 update no-lint tags for flake8 3.0 2016-07-30 15:34:52 -04:00
Jack O'Connor ec7c9497b9 stop flattening reprs, to preserve context 2016-07-30 15:27:58 -04:00
Jack O'Connor dbf05f831f have raises_gathered yield an exception container like assertRaises 2016-07-30 13:53:26 -04:00
Jack O'Connor 5d930eb88f two more 2016-07-30 13:43:38 -04:00
Jack O'Connor 4ebedea3a3 pass the verbose param in reup 2016-07-30 13:37:22 -04:00
Jack O'Connor 0769d514e9 even less verbose plugin error strings 2016-07-20 00:20:06 -04:00
Jack O'Connor 0d443190b5 include reprs in a way that handles verbosity 2016-07-18 19:57:56 -04:00
Jack O'Connor bc9e02f1aa starting to use raises_gathered 2016-07-18 09:36:15 -04:00
Jack O'Connor d5db16f22d add a proper gathered exception type 2016-07-17 18:22:35 -04:00
Jack O'Connor 3847fd8e10 make common plugin errors less verbose 2016-07-04 19:24:08 +09:00
Jack O'Connor d6947a36b5 unbreak the tests 2016-07-04 15:15:10 +09:00
Jack O'Connor fbd7e13930 gather_coalescing_exceptions 2016-07-04 14:09:56 +09:00
Jack O'Connor 191b9f6108 better error message for plugins that don't support reup 2016-07-01 14:37:13 +09:00
Jack O'Connor 5484116b0d remove code review link from README
We haven't used our Phabricator install in a while, and I've disabled it
on my little server.
2016-06-15 14:21:51 -04:00
Jack O'Connor 2c6a90b580 bump version to 1.0.0!
Changes since 0.4.0:
- Add the `drop` rule field.
- Add the `submodules` field to the git plugin, to disable recursive
  submodule fetching.
- Add a warning when overrides are configured but unused.
- Skip directories named .peru in module sources, similar to how git
  skips directories named .git.
- Fix a bug with partially defined git submodules.
2016-05-25 18:20:16 -04:00
Jack O'Connor bd6da1e01e add an unused overrides warning
Closes https://github.com/buildinspace/peru/issues/90.
2016-05-09 10:04:18 -04:00
Jack O'Connor f293ccc1f1 make test_validate_capitalizations slightly more bulletproof 2016-05-08 16:49:12 -04:00
Jack O'Connor 983e5bbc5f fix flake8 on Travis 2016-05-05 01:26:22 -04:00
Jack O'Connor 4c45e9b9f1 allow disabling submodule fetching in the git plugin
Closes https://github.com/buildinspace/peru/issues/158.
2016-05-05 01:12:07 -04:00
Jack O'Connor 5192694ff4 avoid ever importing a .peru directory
This is a security/correctness issue similar to git's issue with .git
dirs, and just like git we need to watch out for case-insensitive
filesystems. See also:
https://github.com/blog/1938-vulnerability-announced-update-your-git-clients.

Closes https://github.com/buildinspace/peru/issues/156.
2016-05-05 00:44:38 -04:00
Jack O'Connor 09ecb52a1c define async.safe_communicate()
Fixes https://github.com/buildinspace/peru/issues/151.
2016-05-05 00:40:49 -04:00
Jack O'Connor f9d7201b3c ignore missing git submodules
Normally when you run `git submodule add ...`, git puts two things in
your repo: an entry in .gitmodules, and a commit object at the
appropriate path inside your repo. However, it's possible for those two
to get out of sync, especially if you use mv/rm on a directory followed
by `git add`, instead of the smarter `git mv`/`git rm`. If we run into
one of these missing submodules, just skip it.

Fixes https://github.com/buildinspace/peru/issues/157.
2016-05-04 21:58:40 -04:00
Jack O'Connor 98ee0baf64 comment typo 2016-05-02 10:35:46 -04:00
Jack O'Connor f97bfc19f9 remove the allowed failure setting on nightly Python
It looks like whatever that coverage bug was has been fixed.
2016-05-02 10:19:54 -04:00
Jack O'Connor 672d9bdbe5 test recursive overrides
This tests that when a recursive override is added (e.g. "A.B"), it
overrides both direct imports of "A.B" and also interior imports of "B"
in module "A". It turns out we were already doing this correctly, though
I honestly expected we weren't :p

Closes https://github.com/buildinspace/peru/issues/89.
2016-05-02 09:59:11 -04:00
Jack O'Connor 944ffad3d6 rename delete to drop 2016-04-27 09:45:12 -04:00
Jack O'Connor 19cda1617d test_delete_and_pick_is_an_error
Dropping everything in a tree was causing modify_tree() to return None,
which lead to a different error when we tried to pass that None back to
git as though it was a valid tree. In retrospect, representing the empty
tree as None was not smart on my part. This diff fixes the modify_tree()
case, though others remain...
2016-04-27 09:45:12 -04:00