Skip to content

Commit

Permalink
docs: add python 2 sunset banner to documentation (#9036)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 committed Nov 11, 2019
1 parent 6acf55c commit 9ea8f1e
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
div#python2-eol {
border-color: red;
border-width: medium;
}
49 changes: 49 additions & 0 deletions packages/google-cloud-resource-manager/docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{% extends "!layout.html" %}
{%- block content %}
{%- if theme_fixed_sidebar|lower == 'true' %}
<div class="document">
{{ sidebar() }}
{%- block document %}
<div class="documentwrapper">
{%- if render_sidebar %}
<div class="bodywrapper">
{%- endif %}

{%- block relbar_top %}
{%- if theme_show_relbar_top|tobool %}
<div class="related top">
&nbsp;
{{- rellink_markup () }}
</div>
{%- endif %}
{% endblock %}

<div class="body" role="main">
<div class="admonition" id="python2-eol">
On January 1, 2020 this library will no longer support Python 2 on the latest released version.
Previously released library versions will continue to be available. For more information please
visit <a href="https://cloud.google.com/python/docs/python2-sunset/">Python 2 support on Google Cloud</a>.
</div>
{% block body %} {% endblock %}
</div>

{%- block relbar_bottom %}
{%- if theme_show_relbar_bottom|tobool %}
<div class="related bottom">
&nbsp;
{{- rellink_markup () }}
</div>
{%- endif %}
{% endblock %}

{%- if render_sidebar %}
</div>
{%- endif %}
</div>
{%- endblock %}
<div class="clearer"></div>
</div>
{%- else %}
{{ super() }}
{%- endif %}
{%- endblock %}
2 changes: 1 addition & 1 deletion packages/google-cloud-resource-manager/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = []
html_static_path = ["_static"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def test_list_projects_no_paging(self):

results = list(client.list_projects())

project, = results
(project,) = results
self.assertEqual(project.project_id, PROJECT_ID)
self.assertEqual(project.number, PROJECT_NUMBER)
self.assertEqual(project.status, STATUS)
Expand Down Expand Up @@ -260,14 +260,14 @@ def test_list_projects_with_filter(self):
FILTER_PARAMS = {"id": "project-id"}
results = list(client.list_projects(filter_params=FILTER_PARAMS))

project, = results
(project,) = results
self.assertEqual(project.project_id, PROJECT_ID)
self.assertEqual(project.number, PROJECT_NUMBER)
self.assertEqual(project.status, STATUS)

# Check that the filter made it in the request.
FLATTENED_FILTER_PARAMS = ["id:project-id"]
request, = client._connection._requested
(request,) = client._connection._requested
self.assertEqual(
request,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_create(self):
self.assertIsNone(project.number)
project.create()
self.assertEqual(project.number, PROJECT_NUMBER)
request, = connection._requested
(request,) = connection._requested

expected_request = {
"method": "POST",
Expand Down Expand Up @@ -142,7 +142,7 @@ def test_reload(self):
self.assertEqual(project.labels, PROJECT_RESOURCE["labels"])
self.assertEqual(project.status, PROJECT_RESOURCE["lifecycleState"])

request, = connection._requested
(request,) = connection._requested
# NOTE: data is not in the request since a GET request.
expected_request = {"method": "GET", "path": project.path}
self.assertEqual(request, expected_request)
Expand Down Expand Up @@ -193,7 +193,7 @@ def test_update(self):
project.labels = LABELS
project.update()

request, = connection._requested
(request,) = connection._requested
expected_request = {
"method": "PUT",
"data": {"name": PROJECT_NAME, "labels": LABELS, "parent": None},
Expand All @@ -217,7 +217,7 @@ def test_delete_without_reload_data(self):
project = self._make_one(PROJECT_ID, client)
project.delete(reload_data=False)

request, = connection._requested
(request,) = connection._requested
# NOTE: data is not in the request since a DELETE request.
expected_request = {"method": "DELETE", "path": project.path}
self.assertEqual(request, expected_request)
Expand Down Expand Up @@ -267,7 +267,7 @@ def test_undelete_without_reload_data(self):
project = self._make_one(PROJECT_ID, client)
project.undelete(reload_data=False)

request, = connection._requested
(request,) = connection._requested
# NOTE: data is not in the request, undelete doesn't need it.
expected_request = {"method": "POST", "path": project.path + ":undelete"}
self.assertEqual(request, expected_request)
Expand Down

0 comments on commit 9ea8f1e

Please sign in to comment.