Commit Graph

15 Commits

Author SHA1 Message Date
Jack O'Connor 36bb7a0279 add `-W all` to tests
Summary:
This enables a bunch of warnings from Python, about things like
deprecated interfaces. It turns out we are using a deprecated library,
the `imp` module, so we switch to `importlib`.

Reviewers: sean

Differential Revision: https://phabricator.buildinspace.com/D208
2015-04-25 22:35:22 -04:00
Jack O'Connor 3a9620e948 fix the coveralls report
Summary:
Ever since the switch from `test.sh` to `test.py`, we've been generating
the `.coverage` file inside `tests/`. Update `.travis.yml` to run
`coveralls` in the right place.

Also, handle the `--with-coverage` flag in a slightly more flexible way.

Test Plan:
Watch the build in my fork and make sure it looks like it's going to
work.

Reviewers: sean

Reviewed By: sean

Differential Revision: https://phabricator.buildinspace.com/D182
2015-01-26 16:41:33 -08:00
Sean Olson 2fbd7a77e3 remove third-party/
Summary:
Remove the third-party/ directory and no longer rely on copies of dependencies
in the repo. When needed, fetch dependencies normally. This can usually be
accomplished via `pip install -r requirements.txt` or `pip install -r
requirements-dev.txt`.

Even though `peru.yaml` is gone, `.peru/` is still in `.gitignore`, because the
tests check for untracked files and will detect `.peru/` as an error.

Test Plan: Successfully ran tests locally and via Travis CI.

Reviewers: jacko

Reviewed By: jacko

Differential Revision: https://phabricator.buildinspace.com/D145
2014-12-20 21:06:36 -08:00
Jack O'Connor f438592800 reimplement shared bash scripts in python
Summary:
We have peru.sh and peru.bat, and also test.sh and test.bat. Rather than
maintaining both of those duplicates to support Windows, just
reimplement them in Python.

There's also validate-third-party.sh, but we never really use that on
Windows. We can port it in a later diff if we feel like it.

Test Plan:
Check that tests actually fail after introducing a bug. (To make sure
we're not actually testing the installed version instead of the repo
version.) Check that the linter fails after dirtying up some code. Check
that the untracked file test fails by creating a random file during
tests.

Reviewers: sean

Reviewed By: sean

Differential Revision: https://phabricator.buildinspace.com/D143
2014-12-18 15:12:14 -08:00
Jack O'Connor 384269d194 delete old hacky tests 2014-05-16 01:12:24 -07:00
Jack O'Connor 74e593b5d9 implement the new plugin model
Delete runtime.py. Rewrite plugin.py to shell out to plugins instead of
running them in process, and get rid of the Plugin class.  Delete the
old git and path plugins and replace them with the new exe variants. The
parser no longer needs to hold and plugin state, so turn all its methods
into toplevel functions.  RemoteModule now just takes a type string
instead of a plugin object.

The idea here is to simplify the interface between peru and its plugins,
and also to make it possible to write plugins in a language other than
Python. In the new model, plugins are invoked on the command line like
this:

  path/to/plugin.py COMMAND [COMMAND_ARGS] [PLUGIN_FIELD VAL]*

For example:

  ./peru/plugins/git_plugin.py fetch /tmp/dest url http://github.com/foo/bar

The other thing the plugin needs is the path where it should do caching,
which is given by the "PERU_PLUGIN_CACHE" environment variable.

The reason for the COMMAND argument is that we're going to want plugins
to support features beyond just fetching, particularly the "reup"
feature, where e.g. the git plugin could update the rev fields in your
git modules based on the state of some remote branch (maybe printing the
new YAML to stdout).
2014-05-03 09:51:53 -07:00
Jack O'Connor 92afb33f57 handle the main build in LocalModule 2014-04-30 00:45:30 -07:00
Jack O'Connor e6de3ccffc remove rule imports
It's not clear how rule imports should work on local modules, especially
with a unified imports tree that should get cleaned up. Remove them for
now unless we find a clear use case for this feature.
2014-04-22 00:17:53 -07:00
Jack O'Connor 5e0e541508 update main 2014-04-20 23:48:58 -07:00
Jack O'Connor 4fb82c483c create LocalModule, and make Parser return one 2014-04-20 23:47:45 -07:00
Jack O'Connor 08275a3577 handle imports 2014-04-20 21:58:47 -07:00
Jack O'Connor c88b0c5d1c Resolver 2014-04-20 15:37:58 -07:00
Jack O'Connor ae89af258b first version of Parser, splitting out RemoteModule 2014-04-20 00:16:27 -07:00
Jack O'Connor 65537ecefb make Rule and Remote fields more explicit
Preparing for a proper parser class, to handle all the YAML details.
2014-04-20 00:00:52 -07:00
Jack O'Connor 81f7ee0052 a very temporary test.py to sanity check these big changes 2014-04-19 16:14:44 -07:00