Repository: wayfair-incubator/pygitops (language: python)

Issue:
Create API Reference
Create an API reference for `pygitops`, documenting all publicly exposed functions, types, exceptions, etc
Implement pygitops source
Relocate source code from wayfair internal pygitops repository


Discussion / hints:

Fix patch:
diff --git a/docker-compose.yaml b/docker-compose.yaml
index f784f58..6f3d576 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -17,10 +17,9 @@ services:
     command: docker/run_tests.sh --format-code
 
   # generate and serve the project documentation locally
-  mkdocs:
-    image: "squidfunk/mkdocs-material:6.0.2"
-    volumes:
-      - ./:/docs
+  mkdocs: &mkdocs
+    <<: *devbox
+    entrypoint: "mkdocs"
     ports:
       - "8000:8000"
-
+    command: ["serve", "--dev-addr=0.0.0.0:8000"]
\ No newline at end of file
diff --git a/docs/api.md b/docs/api.md
new file mode 100644
index 0000000..7d9df96
--- /dev/null
+++ b/docs/api.md
@@ -0,0 +1,5 @@
+# Reference
+
+## Functions
+
+::: pygitops.operations.get_updated_repo
diff --git a/docs/css/mkdocstrings.css b/docs/css/mkdocstrings.css
new file mode 100644
index 0000000..665a1af
--- /dev/null
+++ b/docs/css/mkdocstrings.css
@@ -0,0 +1,34 @@
+/* Indentation. */
+div.doc-contents:not(.first) {
+    padding-left: 25px;
+    border-left: 4px solid rgba(230, 230, 230);
+    margin-bottom: 80px;
+  }
+  
+  /* Don't capitalize names. */
+  h5.doc-heading {
+    text-transform: none !important;
+  }
+  
+  /* Don't use vertical space on hidden ToC entries. */
+  .hidden-toc::before {
+    margin-top: 0 !important;
+    padding-top: 0 !important;
+  }
+  
+  /* Don't show permalink of hidden ToC entries. */
+  .hidden-toc a.headerlink {
+    display: none;
+  }
+  
+  /* Avoid breaking parameters name, etc. in table cells. */
+  td code {
+    word-break: normal !important;
+  }
+  
+  /* For pieces of Markdown rendered in table cells. */
+  td p {
+    margin-top: 0 !important;
+    margin-bottom: 0 !important;
+  }
+  
\ No newline at end of file
diff --git a/mkdocs.yml b/mkdocs.yml
index 84779ff..605b561 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -6,6 +6,7 @@ docs_dir: docs
 nav:
   - Overview: index.md
   - Development Guide: development-guide.md
+  - Reference: api.md
 theme: material
 markdown_extensions:
   - admonition
@@ -13,3 +14,16 @@ markdown_extensions:
   - pymdownx.highlight
   - pymdownx.keys
   - pymdownx.superfences
+plugins:
+  - mkdocstrings:
+      handlers:
+        python:
+          selection:
+            docstring_style: "restructured-text"
+          rendering:
+            heading_level: 3
+            show_root_heading: True
+            show_source: False
+            show_root_full_path: False
+extra_css:
+  - css/mkdocstrings.css
diff --git a/pygitops/__init__.py b/pygitops/__init__.py
old mode 100644
new mode 100755
diff --git a/pygitops/operations.py b/pygitops/operations.py
new file mode 100755
index 0000000..584696f
--- /dev/null
+++ b/pygitops/operations.py
@@ -0,0 +1,12 @@
+from git import Repo
+
+
+# Placeholder function to test autogeneration of function documentation.
+# Will remove during https://github.com/wayfair-incubator/pygitops/issues/23
+def get_updated_repo(repo_name: str) -> Repo:
+    """
+    Get the specified repository, updating if already present.
+
+    :param repo_name: Name of the repository.
+    """
+    return Repo.init("some-path")


Test patch:
diff --git a/requirements-test.txt b/requirements-test.txt
index d4add96..2d5673f 100644
--- a/requirements-test.txt
+++ b/requirements-test.txt
@@ -3,6 +3,8 @@ black==20.8b1
 flake8==3.8.4
 isort==5.7.0
 mypy==0.790
+mkdocs-material==6.2.4
+mkdocstrings==0.14.0
 pytest==6.2.1
 pytest-cov==2.10.1
 pytest-mock==3.5.1