Skip to content

Commit

Permalink
Roll //third_party/typ to v0.9.9
Browse files Browse the repository at this point in the history
This rolls //third_party/typ to v0.9.9 to pick up dglazkov's patch
to allow "foreign arguments" to typ. A foreign argument is one
that the typ arg parser ignores.

This roll includes:

  d77f1a5 bump version to 0.9.9
  69c6119 Merge pull request chromium#7 from dglazkov/foreign-argument
  0a2f193 fix indentation
  c8845b2 Introduce the concept of a foreign argument.

R=dglazkov@chromium.org

Review-Url: https://codereview.chromium.org/2568683002
Cr-Commit-Position: refs/heads/master@{#437789}
  • Loading branch information
dpranke authored and Commit bot committed Dec 11, 2016
1 parent 64a8d3b commit d097264
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions third_party/typ/README.chromium
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: typ
URL: https://github.com/dpranke/typ.git
Version: 0.9.8
Revision: 3df460d1b6d83594e75f6b50f889a240a2e1925e
Version: 0.9.9
Revision: d77f1a5b246a0bbf04eee73c0bef134bf7a7dbcd
Security Critical: no
License: Apache 2.0
License File: NOT_SHIPPED
Expand Down
7 changes: 5 additions & 2 deletions third_party/typ/typ/arg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ def argv_from_args(self, args):
v = d[k]
argname = _argname_from_key(k)
action = self._action_for_key(k)
if not action:
continue
action_str = _action_str(action)
if k == 'tests':
tests = v
Expand Down Expand Up @@ -310,8 +312,9 @@ def _action_for_key(self, key):
if action.dest == key:
return action

assert False, ('Could not find an action for %s' # pragma: no cover
% key)
# Assume foreign argument: something used by the embedder of typ, for
# example.
return None


def _action_str(action):
Expand Down
7 changes: 7 additions & 0 deletions third_party/typ/typ/tests/arg_parser_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ def check(argv, expected=None):
check(['--jobs', '3'])
check(['-vv'], ['--verbose', '--verbose'])

def test_argv_from_args_foreign_argument(self):
parser = ArgumentParser()
parser.add_argument('--some-foreign-argument', default=False,
action='store_true')
args = parser.parse_args(['--some-foreign-argument', '--verbose'])
self.assertEqual(['--verbose'], ArgumentParser().argv_from_args(args))

def test_valid_shard_options(self):
parser = ArgumentParser()

Expand Down
2 changes: 1 addition & 1 deletion third_party/typ/typ/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.

VERSION = '0.9.8'
VERSION = '0.9.9'

0 comments on commit d097264

Please sign in to comment.