Skip to content

Commit

Permalink
Merge branch 'release-1.11.32'
Browse files Browse the repository at this point in the history
* release-1.11.32:
  Bumping version to 1.11.32
  Update changelog based on model updates
  Switch to https
  Include cross links to service API documentation
  • Loading branch information
AWS committed Dec 21, 2016
2 parents e96b61f + 627a772 commit 264936d
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .changes/1.11.32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[
{
"category": "``storagegateway``",
"description": "Update storagegateway command to latest version",
"type": "feature"
},
{
"category": "``firehose``",
"description": "Update firehose command to latest version",
"type": "feature"
},
{
"category": "``route53``",
"description": "Update route53 command to latest version",
"type": "feature"
}
]
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
CHANGELOG
=========

1.11.32
=======

* feature:``storagegateway``: Update storagegateway command to latest version
* feature:``firehose``: Update firehose command to latest version
* feature:``route53``: Update route53 command to latest version


1.11.31
=======

Expand Down
2 changes: 1 addition & 1 deletion awscli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""
import os

__version__ = '1.11.31'
__version__ = '1.11.32'

#
# Get our data path to be added to botocore's search path
Expand Down
20 changes: 20 additions & 0 deletions awscli/clidocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,8 @@ def doc_subitem(self, command_name, help_command, **kwargs):

class OperationDocumentEventHandler(CLIDocumentEventHandler):

AWS_DOC_BASE = 'https://docs.aws.amazon.com/goto/WebAPI'

def build_translation_map(self):
operation_model = self.help_command.obj
d = {}
Expand Down Expand Up @@ -330,6 +332,24 @@ def doc_description(self, help_command, **kwargs):
operation_model = help_command.obj
doc.style.h2('Description')
doc.include_doc_string(operation_model.documentation)
self._add_webapi_crosslink(help_command)

def _add_webapi_crosslink(self, help_command):
doc = help_command.doc
operation_model = help_command.obj
service_model = operation_model.service_model
service_uid = service_model.metadata.get('uid')
if service_uid is None:
# If there's no service_uid in the model, we can't
# be certain if the generated cross link will work
# so we don't generate any crosslink info.
return
doc.style.new_paragraph()
doc.write("See also: ")
link = '%s/%s/%s' % (self.AWS_DOC_BASE, service_uid,
operation_model.name)
doc.style.external_link(title="AWS API Documentation", link=link)
doc.writeln('')

def _json_example_value_name(self, argument_model, include_enum_values=True):
# If include_enum_values is True, then the valid enum values
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# The short X.Y version.
version = '1.11.'
# The full version, including alpha/beta/rc tags.
release = '1.11.31'
release = '1.11.32'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ universal = 1

[metadata]
requires-dist =
botocore==1.4.88
botocore==1.4.89
colorama>=0.2.5,<=0.3.7
docutils>=0.10
rsa>=3.1.2,<=3.5.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import awscli


requires = ['botocore==1.4.88',
requires = ['botocore==1.4.89',
'colorama>=0.2.5,<=0.3.7',
'docutils>=0.10',
'rsa>=3.1.2,<=3.5.0',
Expand Down
35 changes: 35 additions & 0 deletions tests/unit/test_clidocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ def setUp(self):
self.name = 'my-command'
self.event_class = 'aws'

def create_help_command(self):
help_command = mock.Mock()
help_command.doc = ReSTDocument()
help_command.event_class = 'custom'
help_command.arg_table = {}
operation_model = mock.Mock()
operation_model.documentation = 'description'
operation_model.service_model.operation_names = []
help_command.obj = operation_model
return help_command

def test_breadcrumbs_man(self):
# Create an arbitrary help command class. This was chosen
# because it is fairly easy to instantiate.
Expand Down Expand Up @@ -215,6 +226,30 @@ def test_documents_enum_values(self):
self.assertIn('FOO', rendered)
self.assertIn('BAZ', rendered)

def test_description_only_for_crosslink_manpage(self):
help_command = self.create_help_command()
operation_handler = OperationDocumentEventHandler(help_command)
operation_handler.doc_description(help_command=help_command)
rendered = help_command.doc.getvalue().decode('utf-8')
# The links are generated in the "man" mode.
self.assertIn('See also: AWS API Documentation', rendered)

def test_includes_webapi_crosslink_in_html(self):
help_command = self.create_help_command()
# Configure this for 'html' generation:
help_command.obj.service_model.metadata = {'uid': 'service-1-2-3'}
help_command.obj.name = 'myoperation'
help_command.doc.target = 'html'

operation_handler = OperationDocumentEventHandler(help_command)
operation_handler.doc_description(help_command=help_command)
rendered = help_command.doc.getvalue().decode('utf-8')
# Should expect an externa link because we're generating html.
self.assertIn(
'See also: `AWS API Documentation '
'<https://docs.aws.amazon.com/goto/'
'WebAPI/service-1-2-3/myoperation>`_', rendered)


class TestTopicDocumentEventHandlerBase(unittest.TestCase):
def setUp(self):
Expand Down

0 comments on commit 264936d

Please sign in to comment.