Skip to content
Closed

temp #233

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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,4 @@ cython_debug/
#.idea/
/.idea/
/.python-version
/private-key.pem
/payloads/
/*.pem
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.12"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
Expand Down
17 changes: 17 additions & 0 deletions .run/Build Docs.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Build Docs" type="ShConfigurationType">
<option name="SCRIPT_TEXT" value="make clean; make html" />
<option name="INDEPENDENT_SCRIPT_PATH" value="true" />
<option name="SCRIPT_PATH" value="" />
<option name="SCRIPT_OPTIONS" value="" />
<option name="INDEPENDENT_SCRIPT_WORKING_DIRECTORY" value="true" />
<option name="SCRIPT_WORKING_DIRECTORY" value="$PROJECT_DIR$/docs" />
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/zsh" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="false" />
<option name="EXECUTE_SCRIPT_FILE" value="false" />
<envs />
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ A handler helper to create GitHub App easily
[![Code Quality](https://github.com/heitorpolidoro/github-app-handler/actions/workflows/code_quality.yml/badge.svg)](https://github.com/heitorpolidoro/github-app-handler/actions/workflows/code_quality.yml)
[![CodeQL](https://github.com/heitorpolidoro/github-app-handler/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/heitorpolidoro/github-app-handler/actions/workflows/github-code-scanning/codeql)
[![PyPi Package](https://github.com/heitorpolidoro/github-app-handler/actions/workflows/pypi-publish.yml/badge.svg)](https://github.com/heitorpolidoro/github-app-handler/actions/workflows/pypi-publish.yml)
[![Documentation Status](https://readthedocs.org/projects/github-app-handler/badge/?version=latest)](https://github-app-handler.readthedocs.io/en/latest/?badge=latest)
<br>
[![Latest Version](https://img.shields.io/github/v/release/heitorpolidoro/github-app-handler?label=Latest%20Version)](https://github.com/heitorpolidoro/github-app-handler/releases/latest)
![GitHub Release Date](https://img.shields.io/github/release-date/heitorpolidoro/github-app-handler)
[![Documentation Status](https://readthedocs.org/projects/github-app-handler/badge/?version=latest)](https://github-app-handler.readthedocs.io/en/latest/?badge=latest)
<br>
![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/heitorpolidoro/github-app-handler/latest)
![GitHub last commit](https://img.shields.io/github/last-commit/heitorpolidoro/github-app-handler)
Expand Down
63 changes: 48 additions & 15 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
"""

import os
import sys
from string import Template

sys.path.insert(0, os.path.abspath("../"))
sys.path.insert(0, os.path.abspath("../githubapp"))

project = "Github App Handler"
copyright = "2024, Heitor Polidoro"
author = "Heitor Polidoro"
Expand All @@ -18,28 +25,54 @@
extensions = [
"myst_parser",
"sphinx.ext.autodoc",
"autodoc2",
# "sphinx.ext.intersphinx",
# "sphinx.ext.viewcode",
# "sphinxcontrib.bibtex",
# "sphinx_panels",
# "sphinxext.rediraffe",
# "sphinxcontrib.mermaid",
# "sphinxext.opengraph",
"sphinx.ext.autosummary",
"sphinx_copybutton",
"sphinx.ext.napoleon",
]
myst_enable_extensions = ["colon_fence"]
myst_enable_extensions = ["colon_fence", "fieldlist"]

# Autodoc2 Configuration
autodoc2_render_plugin = "myst"
autodoc2_packages = ["../githubapp"]
autodoc2_hidden_objects = ["inherited", "dunder", "private"]
autodoc2_sort_names = True
pygments_style = "sphinx"

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# Whether to prepend module names to object names in `.. autoclass::` etc.
add_module_names = False
# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_theme_options = {
"titles_only": True,
}

napoleon_google_docstring = True
autodoc_member_order = "bysource"


def generate_class_doc(clazz):
template = """$className
==================

.. currentmodule:: $module
.. autoclass:: $className
:show-inheritance:
:members:
"""
return Template(template).substitute(
className=clazz.__name__, module=clazz.__module__
)


def generate_module_docs(module, path=".", exclude=None):
exclude = exclude or []
for clazz in vars(module).values():
if isinstance(clazz, type) and clazz.__name__ not in exclude:
file_name = clazz.__module__.replace(f"{module.__package__}.", "") + ".rst"

content = generate_class_doc(clazz)
with open(os.path.join(path, file_name), "w") as file:
file.write(content)


# generate_module_docs(loaders, "classes", exclude=["ConfigEnvVarLoader", "ConfigLoader"])
29 changes: 0 additions & 29 deletions docs/index.md

This file was deleted.

35 changes: 35 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Github App Handler
==================

Github App Handler it is a handler helper to create GitHub App easily

# TODO complete the toc

.. toctree::
:hidden:

Home <self>

Introduction
============

Github App Handler is a Python library that helps to create
[Github App](https://docs.github.com/en/apps/creating-github-apps).
It uses the [PyGithub](https://docs.github.com/en/apps/creating-github-apps) library to manage the Github resources

Installation
============
.. code:: shell

pip install github-app-handler


Usage
============

# TODO

.. code:: python

...

10 changes: 3 additions & 7 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
sphinx==7.3.7
myst_parser==3.0.1
sphinx-autodoc2==0.5.0
github-app-handler==0.28.4

sphinx_rtd_theme==2.0.0
readthedocs-sphinx-search==0.3.2
myst_parser
sphinx_rtd_theme
sphinx-copybutton
13 changes: 0 additions & 13 deletions githubapp/__init__.py

This file was deleted.

116 changes: 0 additions & 116 deletions githubapp/config.py

This file was deleted.

Loading
Loading