feat: Add new gcloud commands, API clients, and third-party libraries across various services.

This commit is contained in:
2026-01-01 20:26:35 +01:00
parent 5e23cbece0
commit a19e592eb7
25221 changed files with 8324611 additions and 0 deletions

View File

@@ -0,0 +1,210 @@
# -*- coding: utf-8 -*-
#
# Mock documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 17 18:12:00 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
#
# All configuration values have a default value; values that are commented out
# serve to show the default value.
import sys, os
sys.path.insert(0, os.path.abspath('..'))
import mock
# If your extensions are in another directory, add it here. If the directory
# is relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#sys.path.append(os.path.abspath('some/directory'))
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.doctest']
doctest_global_setup = """
import os
import sys
import mock
from mock import * # yeah, I know :-/
import unittest2
import __main__
if os.getcwd() not in sys.path:
sys.path.append(os.getcwd())
# keep a reference to __main__
sys.modules['__main'] = __main__
class ProxyModule(object):
def __init__(self):
self.__dict__ = globals()
sys.modules['__main__'] = ProxyModule()
"""
doctest_global_cleanup = """
sys.modules['__main__'] = sys.modules['__main']
"""
html_theme = 'nature'
html_theme_options = {}
# Add any paths that contain templates here, relative to this directory.
#templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.txt'
# The master toctree document.
master_doc = 'index'
# General substitutions.
project = u'Mock'
copyright = u'2007-2015, Michael Foord & the mock team'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents. Supplied by pbr.
#
# The short X.Y version.
version = mock.mock._v.brief_string()
# The full version, including alpha/beta/rc tags.
release = mock.__version__
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used: (Set from pbr)
today = ''
# Else, today_fmt is used as the format for a strftime call.
# today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
#unused_docs = []
# List of directories, relative to source directories, that shouldn't be searched
# for source files.
exclude_trees = []
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
add_module_names = False
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'friendly'
# Options for HTML output
# -----------------------
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
#html_style = 'adctheme.css'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# 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 = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
html_use_modindex = False
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, the reST sources are included in the HTML build as _sources/<name>.
#html_copy_source = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# Output file base name for HTML help builder.
htmlhelp_basename = 'Mockdoc'
# Options for LaTeX output
# ------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
latex_font_size = '12pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
('index', 'Mock.tex', u'Mock Documentation',
u'Michael Foord', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
latex_use_modindex = False

View File

@@ -0,0 +1,189 @@
====================================
Mock - Mocking and Testing Library
====================================
:Version: |release|
:Date: |today|
:Homepage: `Mock Homepage`_
:Download: `Mock on PyPI`_
:Documentation: `Python Docs`_
:License: `BSD License`_
:Support: `Mailing list (testing-in-python@lists.idyll.org)
<http://lists.idyll.org/listinfo/testing-in-python>`_
:Issue tracker: `Github Issues
<https://github.com/testing-cabal/mock/issues>`_
:Last sync: cb6aab1248c4aec4dd578bea717854505a6fb55d
.. _Mock Homepage: https://github.com/testing-cabal/mock
.. _BSD License: http://github.com/testing-cabal/mock/blob/master/LICENSE.txt
.. _Python Docs: https://docs.python.org/dev/library/unittest.mock.html
.. module:: mock
:synopsis: Mock object and testing library.
.. index:: introduction
TOC
+++
.. toctree::
:maxdepth: 2
changelog
Introduction
++++++++++++
mock is a library for testing in Python. It allows you to replace parts of
your system under test with mock objects and make assertions about how they
have been used.
mock is now part of the Python standard library, available as
``unittest.mock`` in Python 3.3 onwards. However, if you are writing code that
runs on multiple versions of Python the ``mock`` package is better, as you get
the newest features from the latest release of Python available for all
Pythons.
The ``mock`` package contains a rolling backport of the standard library mock
code compatible with Python 2.6 and up, and 3.3 and up. Python 3.2 is supported
by mock 1.3.0 and below - with pip no longer supporting 3.2, we cannot test
against that version anymore.
Please see the standard library documentation for usage details.
.. index:: installing
.. _installing:
Installing
++++++++++
The current version is |release|. Mock is stable and widely used.
* `mock on PyPI <http://pypi.python.org/pypi/mock>`_
.. index:: repository
.. index:: git
You can checkout the latest development version from Github
repository with the following command:
``git clone https://github.com/testing-cabal/mock``
.. index:: pip
You can install mock with pip:
| ``pip install -U mock``
Alternatively you can download the mock distribution from PyPI and after
unpacking run:
``python setup.py install``
.. index:: bug reports
Bug Reports
+++++++++++
Mock uses `unittest2 <http://pypi.python.org/pypi/unittest2>`_ for its own
Issues with the backport process, such as compatibility with a particular
Python, should be reported to the `bug tracker
<https://github.com/testing-cabal/mock/issues>`_. Feature requests and issues
with Mock functionality should be reported to the `Python bug tracker
<https://bugs.python.org>`_.
.. index:: python changes
Python Changes
++++++++++++++
Python NEWS entries from cPython:
.. include:: ../NEWS
.. index:: older versions
Older Versions of Python
++++++++++++++++++++++++
Version 1.0.1 is the last version compatible with Python < 2.6.
.. index:: maintainer notes
Maintainer Notes
++++++++++++++++
Development
===========
Checkout from git (see :ref:`installing`) and submit pull requests.
Committers can just push as desired: since all semantic development takes
place in cPython, the backport process is as lightweight as we can make it.
mock is CI tested using Travis-CI on Python versions 2.6, 2.7, 3.3, 3.4,
3.5, nightly Python 3 builds, pypy, pypy3. Jython support is desired, if
someone could contribute a patch to .travis.yml to support it that would be
excellent.
Releasing
=========
NB: please use semver. Bump the major component on API breaks, minor on all
non-bugfix changes, patch on bugfix only changes.
1. tag -s, push --tags origin master
2. setup.py sdist bdist_wheel upload -s
Backporting rules
=================
isinstance checks in cPython to ``type`` need to check ``ClassTypes``.
Code calling ``obj.isidentifier`` needs to change to ``_isidentifier(obj)``.
Backporting process
===================
1. Patch your git am with `my patch <https://github.com/rbtcollins/git>`_.
2. Install the applypatch-transform hook from tools/ to your .git hooks dir.
3. Configure a pre-applypatch hook to test at least all the cPython versions
we support on each patch that is applied. I use containers, and a sample
script is in tools/pre-applypatch.
4. Pull down the cPython git mirror: https://github.com/python/cpython.git
5. Export the new revisions since the ``Last sync`` at the top of this
document::
revs=${lastsync}
rm migrate-export
git log --pretty="format:%H " $revs.. -- Lib/unittest/mock.py \
Lib/unittest/test/testmock/ > migrate-revs
tac migrate-revs > migrate-sorted-revs
for rev in $(< migrate-sorted-revs); do
git format-patch -1 $rev -k --stdout >> migrate-export;
done
echo NEW SYNC POINT: $(git rev-parse HEAD)
6. Import into mock::
git am -k --reject $path-to-cpython/migrate-export
This will transform the patches automatically. Currently it will error
on every NEWS change as I haven't gotten around to making those patches
automatic. Fixup any errors that occur. When the patch is ready, do a ``git
add -u`` to update the index and then ``git am --continue`` to move onto
the next patch. If the patch is inappropriate e.g. the patch removing
__ne__ which would break older pythons, then either do ``git reset --hard;
git am --skip`` to discard any partially applied changes and skip over it,
or, if it has a NEWS entry thats worth preserving, edit it down to just
that, with a note such as we have for the ``__ne__`` patch, and continue on
from there.
The goal is that every patch work at all times.
7. After the import is complete, update this document with the new sync point.
8. Push to a personal branch and propose a PR to the main repo. This will make
Travis-CI test it. If it works, push to the main repo.