Skip to content

Commit

Permalink
Merge branch 'release-1.26.81'
Browse files Browse the repository at this point in the history
* release-1.26.81:
  Bumping version to 1.26.81
  Add changelog entries from botocore
  Added changelog for nested docs
  Implemented Nested Docs. (#3597)
  • Loading branch information
aws-sdk-python-automation committed Feb 28, 2023
2 parents 9fd2749 + 5f92a2b commit 3d48469
Show file tree
Hide file tree
Showing 30 changed files with 1,090 additions and 332 deletions.
42 changes: 42 additions & 0 deletions .changes/1.26.81.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"category": "Documentation",
"description": "Splits service documentation into multiple sub-pages for better organization and faster loading time.",
"type": "enhancement"
},
{
"category": "Documentation",
"description": "[``botocore``] Splits service documentation into multiple sub-pages for better organization and faster loading time.",
"type": "enhancement"
},
{
"category": "``comprehend``",
"description": "[``botocore``] Amazon Comprehend now supports flywheels to help you train and manage new model versions for custom models.",
"type": "api-change"
},
{
"category": "``ec2``",
"description": "[``botocore``] This release allows IMDS support to be set to v2-only on an existing AMI, so that all future instances launched from that AMI will use IMDSv2 by default.",
"type": "api-change"
},
{
"category": "``kms``",
"description": "[``botocore``] AWS KMS is deprecating the RSAES_PKCS1_V1_5 wrapping algorithm option in the GetParametersForImport API that is used in the AWS KMS Import Key Material feature. AWS KMS will end support for this wrapping algorithm by October 1, 2023.",
"type": "api-change"
},
{
"category": "``lightsail``",
"description": "[``botocore``] This release adds Lightsail for Research feature support, such as GUI session access, cost estimates, stop instance on idle, and disk auto mount.",
"type": "api-change"
},
{
"category": "``managedblockchain``",
"description": "[``botocore``] This release adds support for tagging to the accessor resource in Amazon Managed Blockchain",
"type": "api-change"
},
{
"category": "``omics``",
"description": "[``botocore``] Minor model changes to accomodate batch imports feature",
"type": "api-change"
}
]
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
CHANGELOG
=========

1.26.81
=======

* enhancement:Documentation: Splits service documentation into multiple sub-pages for better organization and faster loading time.
* enhancement:Documentation: [``botocore``] Splits service documentation into multiple sub-pages for better organization and faster loading time.
* api-change:``comprehend``: [``botocore``] Amazon Comprehend now supports flywheels to help you train and manage new model versions for custom models.
* api-change:``ec2``: [``botocore``] This release allows IMDS support to be set to v2-only on an existing AMI, so that all future instances launched from that AMI will use IMDSv2 by default.
* api-change:``kms``: [``botocore``] AWS KMS is deprecating the RSAES_PKCS1_V1_5 wrapping algorithm option in the GetParametersForImport API that is used in the AWS KMS Import Key Material feature. AWS KMS will end support for this wrapping algorithm by October 1, 2023.
* api-change:``lightsail``: [``botocore``] This release adds Lightsail for Research feature support, such as GUI session access, cost estimates, stop instance on idle, and disk auto mount.
* api-change:``managedblockchain``: [``botocore``] This release adds support for tagging to the accessor resource in Amazon Managed Blockchain
* api-change:``omics``: [``botocore``] Minor model changes to accomodate batch imports feature


1.26.80
=======

Expand Down
2 changes: 1 addition & 1 deletion boto3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from boto3.session import Session

__author__ = 'Amazon Web Services'
__version__ = '1.26.80'
__version__ = '1.26.81'


# The default Boto3 session; autoloaded when needed.
Expand Down
4 changes: 3 additions & 1 deletion boto3/docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ def generate_docs(root_dir, session):
os.makedirs(services_doc_path)

for service_name in session.get_available_services():
docs = ServiceDocumenter(service_name, session).document_service()
docs = ServiceDocumenter(
service_name, session, services_doc_path
).document_service()
service_doc_path = os.path.join(
services_doc_path, service_name + '.rst'
)
Expand Down
20 changes: 17 additions & 3 deletions boto3/docs/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import os

from botocore import xform_name
from botocore.docs.bcdoc.restdoc import DocumentStructure
from botocore.docs.method import (
document_custom_method,
document_model_driven_method,
)
from botocore.model import OperationModel
from botocore.utils import get_service_module_name

from boto3.docs.base import BaseDocumenter
from boto3.docs.base import NestedDocumenter
from boto3.docs.method import document_model_driven_resource_method
from boto3.docs.utils import (
add_resource_type_overview,
Expand All @@ -27,7 +30,7 @@
)


class ActionDocumenter(BaseDocumenter):
class ActionDocumenter(NestedDocumenter):
def document_actions(self, section):
modeled_actions_list = self._resource_model.actions
modeled_actions = {}
Expand All @@ -49,7 +52,10 @@ def document_actions(self, section):
)

for action_name in sorted(resource_actions):
action_section = section.add_new_section(action_name)
# Create a new DocumentStructure for each action and add contents.
action_doc = DocumentStructure(action_name, target='html')
action_doc.add_title_section(action_name)
action_section = action_doc.add_new_section(action_name)
if action_name in ['load', 'reload'] and self._resource_model.load:
document_load_reload_action(
section=action_section,
Expand All @@ -71,6 +77,14 @@ def document_actions(self, section):
document_custom_method(
action_section, action_name, resource_actions[action_name]
)
# Write actions in individual/nested files.
# Path: <root>/reference/services/<service>/<resource_name>/<action_name>.rst
actions_dir_path = os.path.join(
self._root_docs_path,
f'{self._service_name}',
f'{self._resource_sub_path}',
)
action_doc.write_to_file(actions_dir_path, action_name)


def document_action(
Expand Down
9 changes: 9 additions & 0 deletions boto3/docs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ def __init__(self, resource):
@property
def class_name(self):
return f'{self._service_docs_name}.{self._resource_name}'


class NestedDocumenter(BaseDocumenter):
def __init__(self, resource, root_docs_path):
super().__init__(resource)
self._root_docs_path = root_docs_path
self._resource_sub_path = self._resource_name.lower()
if self._resource_name == self._service_name:
self._resource_sub_path = 'service-resource'
23 changes: 20 additions & 3 deletions boto3/docs/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,22 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import os

from botocore import xform_name
from botocore.docs.bcdoc.restdoc import DocumentStructure
from botocore.docs.method import get_instance_public_methods
from botocore.docs.utils import DocumentedShape

from boto3.docs.base import BaseDocumenter
from boto3.docs.base import NestedDocumenter
from boto3.docs.method import document_model_driven_resource_method
from boto3.docs.utils import (
add_resource_type_overview,
get_resource_ignore_params,
)


class CollectionDocumenter(BaseDocumenter):
class CollectionDocumenter(NestedDocumenter):
def document_collections(self, section):
collections = self._resource.meta.resource_model.collections
collections_list = []
Expand All @@ -37,10 +40,24 @@ def document_collections(self, section):
)
self.member_map['collections'] = collections_list
for collection in collections:
collection_section = section.add_new_section(collection.name)
collections_list.append(collection.name)
# Create a new DocumentStructure for each collection and add contents.
collection_doc = DocumentStructure(collection.name, target='html')
collection_doc.add_title_section(collection.name)
collection_section = collection_doc.add_new_section(
collection.name
)
self._document_collection(collection_section, collection)

# Write collections in individual/nested files.
# Path: <root>/reference/services/<service>/<resource_name>/<collection_name>.rst
collections_dir_path = os.path.join(
self._root_docs_path,
f'{self._service_name}',
f'{self._resource_sub_path}',
)
collection_doc.write_to_file(collections_dir_path, collection.name)

def _document_collection(self, section, collection):
methods = get_instance_public_methods(
getattr(self._resource, collection.name)
Expand Down
Loading

0 comments on commit 3d48469

Please sign in to comment.