Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
25 changes: 16 additions & 9 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ build:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"
jobs:
# Empty build step to override and stop standard Sphinx/MkDocs execution
build: []
# Copy your raw HTML directly to the hosted output folder
post_build:
- mkdir -p $READTHEDOCS_OUTPUT/html
- cp -r doc/html/* $READTHEDOCS_OUTPUT/html/

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: doc/source/conf.py
# sphinx:
# configuration: doc/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
Expand All @@ -30,13 +37,13 @@ sphinx:
# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: doc/requirements-docs.txt
- requirements: test-requirements.txt
- requirements: requirements.txt


#python:
# install:
# - requirements: doc/requirements-docs.txt
# - requirements: test-requirements.txt
# - requirements: requirements.txt
#
#
# git clone --depth 1 https://github.com/kubernetes-client/python .
# git fetch origin --force --prune --prune-tags --depth 50 refs/heads/master:refs/remotes/origin/master
# git checkout --force origin/master
Expand Down
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ rst:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
html: rst
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) -j 200 $(O)
@echo "\nDocs rendered successfully, open _/build/html/index.html to view"
4 changes: 4 additions & 0 deletions doc/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
config: e27944d538b14f623238f31059d3f396
tags: 645f666f9bcd5a90fca523b33c5a78b7
197 changes: 197 additions & 0 deletions doc/html/CONTRIBUTING.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
<!DOCTYPE html>

<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

<title>Contributing Guidelines &#8212; kubernetes-python-client documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="_static/basic.css?v=b08954a9" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css?v=27fed22d" />
<script src="_static/documentation_options.js?v=5929fcd5"></script>
<script src="_static/doctools.js?v=fd6eb6e6"></script>
<script src="_static/sphinx_highlight.js?v=6ffebe34"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="kubernetes.utils.retry_test module" href="kubernetes.utils.retry_test.html" />

<link rel="stylesheet" href="_static/custom.css" type="text/css" />





</head><body>


<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">


<div class="body" role="main">

<section id="contributing-guidelines">
<h1>Contributing Guidelines<a class="headerlink" href="#contributing-guidelines" title="Link to this heading">¶</a></h1>
<section id="how-to-become-a-contributor-and-submit-your-own-code">
<h2>How to become a contributor and submit your own code<a class="headerlink" href="#how-to-become-a-contributor-and-submit-your-own-code" title="Link to this heading">¶</a></h2>
<section id="contributor-license-agreements">
<h3>Contributor License Agreements<a class="headerlink" href="#contributor-license-agreements" title="Link to this heading">¶</a></h3>
<p>We’d love to accept your patches! Before we can take them, we have to jump a couple of legal hurdles.</p>
<p>Please fill out either the individual or corporate Contributor License Agreement (CLA).</p>
<ul class="simple">
<li><p>If you are an individual writing original source code and you’re sure you own the intellectual property, then you’ll need to sign an <a class="reference external" href="https://identity.linuxfoundation.org/node/285/node/285/individual-signup">individual CLA</a>.</p></li>
<li><p>If you work for a company that wants to allow you to contribute your work, then you’ll need to sign a <a class="reference external" href="https://identity.linuxfoundation.org/node/285/organization-signup">corporate CLA</a>.</p></li>
</ul>
<p>Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we’ll be able to accept your pull requests.</p>
</section>
</section>
<section id="composition-of-this-repository-and-where-how-to-contribute">
<h2>Composition of This Repository and Where/How to Contribute<a class="headerlink" href="#composition-of-this-repository-and-where-how-to-contribute" title="Link to this heading">¶</a></h2>
<p>The Kubernetes Python client contains mostly files that are generated by the OpenAPI generator from <a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/scripts/swagger.json">this OpenAPI spec</a>. In the repo there is also the utility part, which allows developers to create their own kubernetes clients (<a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/base">kubernetes/base</a>). The base repo was once a submodule of the main repo, but is now integrated into the main repo. The archived code is available (<a class="reference external" href="https://github.com/kubernetes-client/python-base">here</a>).</p>
<section id="where-to-submit-your-patch">
<h3>Where to Submit Your Patch<a class="headerlink" href="#where-to-submit-your-patch" title="Link to this heading">¶</a></h3>
<p>The following folders are automatically generated. You will need to submit a patch to the upstream Kubernetes repo <a class="reference external" href="https://github.com/kubernetes/kubernetes">kubernetes</a> or the OpenAPI generator repo <a class="reference external" href="https://github.com/OpenAPITools/openapi-generator">openapi-generator</a>.</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/client">kubernetes/client</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/test">kubernetes/test</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/docs">kubernetes/docs</a>.</p></li>
</ul>
<p>In this main repo, the following folders contain developer written codes and the patches should be submitted as pull requests here:</p>
<ul class="simple">
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/base">kubernetes/base</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/config">kubernetes/config</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/dynamic">kubernetes/dynamic</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/e2e_test">kubernetes/e2e_test</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/leaderelection">kubernetes/leaderelection</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/stream">kubernetes/stream</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/utils">kubernetes/utils</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/watch">kubernetes/watch</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/examples">examples</a></p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/scripts">scripts</a>.</p></li>
</ul>
</section>
<section id="contributing-a-patch">
<h3>Contributing A Patch<a class="headerlink" href="#contributing-a-patch" title="Link to this heading">¶</a></h3>
<ol class="simple">
<li><p>Submit an issue describing your proposed change to the repo in question.</p></li>
<li><p>The <a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/OWNERS">repo owners</a> will respond to your issue promptly.</p></li>
<li><p>If your proposed change is accepted, and you haven’t already done so, sign a Contributor License Agreement (see details above).</p></li>
<li><p>Fork the desired repo, develop and test your code changes. Add a test if possible.</p></li>
<li><p>Submit a pull request.</p></li>
</ol>
</section>
<section id="adding-dependencies">
<h3>Adding Dependencies<a class="headerlink" href="#adding-dependencies" title="Link to this heading">¶</a></h3>
<p>If your patch depends on new packages, add those packages to <a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/requirements.txt">requirements.txt</a> and/or <a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/setup.py">setup.py</a>. If these package are for testing only, add those to <a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/test-requirements.txt">test-requirements.txt</a>.</p>
</section>
<section id="commits">
<h3>Commits<a class="headerlink" href="#commits" title="Link to this heading">¶</a></h3>
<p>Generally we would like to see one commit per pull request. However, if the pull request is reasonably large, the PR can be divided into several commits that make logical sense. The commit message should be clear and indicative of the aim of the fix. Sometimes multiple commits in a single pull request is acceptable if it meets the Kubernetes <a class="reference external" href="https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#6-squashing-and-commit-titles">pull request guidelines</a>.</p>
<p>If you have several commits in a pull request and have been asked to squash your commits, please use <code class="docutils literal notranslate"><span class="pre">git</span> <span class="pre">reset</span> <span class="pre">--soft</span> <span class="pre">HEAD~N_COMMITS</span></code> and commit again to make your PR a single commit.</p>
</section>
<section id="windows-developers">
<h3>Windows Developers<a class="headerlink" href="#windows-developers" title="Link to this heading">¶</a></h3>
<p>The symbolic links contained in this repo do not work for Windows operating systems. If you are a Windows developer, please run the <a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/scripts/windows-setup-fix.bat">fix</a> inside the scripts folder or manually copy the content of the <a class="reference external" href="https://github.com/kubernetes-client/python-base">kubernetes/base</a> folder into the <a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes">kubernetes</a> folder.</p>
</section>
<section id="writing-tests">
<h3>Writing Tests<a class="headerlink" href="#writing-tests" title="Link to this heading">¶</a></h3>
<p>In addition to running the fix yourself and telling us that your fix works, you can demonstrate that your fix really works by using unit tests and end to end tests. Tests are mainly located in three places. You should put your tests into the places that they fit in.</p>
<ol class="simple">
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/test">Generated tests</a> by OpenAPI generator: these tests should pass and do not require modification.</p></li>
<li><p><a class="reference external" href="https://github.com/kubernetes-client/python/blob/master/kubernetes/e2e_test">End to end tests</a>: these are tests that can only be verified with a live kubernetes server.</p></li>
<li><p>Base repo tests in the <a class="reference external" href="https://github.com/kubernetes-client/python-base">base</a> repo, in which the test files are named <code class="docutils literal notranslate"><span class="pre">test_*.py</span></code>: These tests use the package <code class="docutils literal notranslate"><span class="pre">Mock</span></code> and confirms the functionality of the base repo files.</p></li>
</ol>
</section>
<section id="coding-style">
<h3>Coding Style<a class="headerlink" href="#coding-style" title="Link to this heading">¶</a></h3>
<p>We use an automatic coding style checker by using the <code class="docutils literal notranslate"><span class="pre">diff</span></code> of the autopep8 output and your code file. To make sure that your code passes the coding style checker, run <code class="docutils literal notranslate"><span class="pre">autopep8</span> <span class="pre">--in-place</span> <span class="pre">--aggressive</span> <span class="pre">--aggressive</span> <span class="pre">your_code.py</span></code> before committing and submitting.</p>
</section>
</section>
<section id="running-tests-locally">
<h2>Running Tests Locally<a class="headerlink" href="#running-tests-locally" title="Link to this heading">¶</a></h2>
<p>If you write a new end to end (e2e) test, or change behaviors that affect e2e tests, you should set up a local cluster and test them on your machine. The following steps will help you run the unit tests.</p>
<ol class="simple">
<li><p>Acquire a local cluster. <a class="reference external" href="https://github.com/kubernetes/minikube">Minikube</a> is a good choice for Windows and Linux developers. Alternatively if you are on Linux, you can clone the <a class="reference external" href="https://github.com/kubernetes/kubernetes">kubernetes</a> repo and run <a class="reference external" href="https://github.com/kubernetes/kubernetes/blob/master/hack/install-etcd.sh">install-etcd.sh</a> and then <a class="reference external" href="https://github.com/kubernetes/kubernetes/blob/master/hack/local-up-cluster.sh">local-up-cluster.sh</a> to get a local cluster up and running.</p></li>
<li><p>Run the unit tests. In the root directory of the main repo, run <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">unittest</span> <span class="pre">discover</span></code>.</p></li>
<li><p>Check the test results and make corresponding fixes.</p></li>
</ol>
</section>
</section>


</div>

</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="Main">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">kubernetes-python-client</a></h1>









<search id="searchbox" style="display: none" role="search">
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="Search"/>
<input type="submit" value="Go" />
</form>
</div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script><h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="README.html">README</a></li>
<li class="toctree-l1"><a class="reference internal" href="usage.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="modules.html">kubernetes</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">contributing</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#how-to-become-a-contributor-and-submit-your-own-code">How to become a contributor and submit your own code</a></li>
<li class="toctree-l2"><a class="reference internal" href="#composition-of-this-repository-and-where-how-to-contribute">Composition of This Repository and Where/How to Contribute</a></li>
<li class="toctree-l2"><a class="reference internal" href="#running-tests-locally">Running Tests Locally</a></li>
</ul>
</li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="kubernetes.utils.retry_test.html" title="previous chapter">kubernetes.utils.retry_test module</a></li>
</ul></li>
</ul>
</div>








</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&#169;2017, Kubernetes.

|
Powered by <a href="https://www.sphinx-doc.org/">Sphinx 9.0.4</a>
&amp; <a href="https://alabaster.readthedocs.io">Alabaster 1.0.0</a>

|
<a href="_sources/CONTRIBUTING.md.txt"
rel="nofollow">Page source</a>
</div>




</body>
</html>
Loading