Skip to content

Commit

Permalink
Improve linting, update docs and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
dormant-user committed May 26, 2024
1 parent 80f4180 commit fe8b920
Show file tree
Hide file tree
Showing 21 changed files with 585 additions and 446 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/markdown-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:

jobs:
none-shall-pass:
runs-on:
- self-hosted
- Ubuntu
runs-on: thevickypedia-default
steps:
- uses: thevickypedia/none-shall-pass@v5
30 changes: 6 additions & 24 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
# This workflow will upload a Python Package using Twine when a release is created

name: pypi-publish

# Controls when the workflow will run
on:
workflow_dispatch: {}
workflow_dispatch:
release:
types: [ published ]

jobs:
deploy:
runs-on: self-hosted
pypi-publisher:
runs-on: thevickypedia-default
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Create packages
run: python -m build
- name: Run twine check
run: twine check dist/*
- name: Upload to pypi
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: twine upload dist/*.whl
- uses: thevickypedia/pypi-publisher@v3
env:
token: ${{ secrets.PYPI_TOKEN }}
90 changes: 52 additions & 38 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,56 @@
---
fail_fast: true
exclude: ^docs/
exclude: ^(notebooks/|scripts/|.github/|docs/)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-byte-order-marker
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-aws-credentials
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: name-tests-test
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-json
- id: check-added-large-files
- id: check-ast
- id: check-byte-order-marker
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-toml
- id: check-vcs-permalinks
- id: check-xml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-aws-credentials
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: name-tests-test
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

- repo: local
hooks:
- id: runbook
name: runbook
entry: /bin/bash gen_docs.sh
language: system
pass_filenames: false
always_run: true
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [-j8, '--ignore=F401,W503,E203,E501,F821,E306,E722,N812']

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
hooks:
- id: yamlfmt

- repo: local
hooks:
- id: runbook
name: runbook
entry: /bin/bash gen_docs.sh
language: system
pass_filenames: false
always_run: true
40 changes: 21 additions & 19 deletions doc_generator/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,64 +13,66 @@
import os
import sys

sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))

# -- Project information -----------------------------------------------------

project = 'Gmail Connector'
copyright = '2021, Vignesh Rao'
author = 'Vignesh Rao'
project = "Gmail Connector"
copyright = "2021, Vignesh Rao"
author = "Vignesh Rao"

# -- 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.napoleon', # certain styles of doc strings
'sphinx.ext.autodoc', # generates from doc strings
'recommonmark', # supports markdown integration
"sphinx.ext.napoleon", # certain styles of doc strings
"sphinx.ext.autodoc", # generates from doc strings
"recommonmark", # supports markdown integration
]

# Exclude private members in the docs
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_default_options
autodoc_default_options = {"members": True, "undoc-members": True, "private-members": False}
autodoc_default_options = {
"members": True,
"undoc-members": True,
"private-members": False,
}

# https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html#configuration
napoleon_google_docstring = True
napoleon_use_param = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# https://www.sphinx-doc.org/en/master/usage/theming.html#builtin-themes
html_theme = 'classic'
html_theme_options = {
"body_max_width": "80%"
}
html_theme = "classic"
html_theme_options = {"body_max_width": "80%"}

# 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']
html_static_path = ["_static"]

# Add docstrings from __init__ method
# Reference: https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autoclass_content
autoclass_content = 'both'
autoclass_content = "both"

# Add support to mark down files in sphinx documentation
# Reference: https://www.sphinx-doc.org/en/1.5.3/markdown.html
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
".rst": "restructuredtext",
".txt": "markdown",
".md": "markdown",
}
2 changes: 2 additions & 0 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ <h2 id="C">C</h2>
<li><a href="index.html#gmailconnector.models.options.Condition">Condition (class in gmailconnector.models.options)</a>
</li>
<li><a href="index.html#gmailconnector.models.responder.Response.count">count (gmailconnector.models.responder.Response property)</a>
</li>
<li><a href="index.html#gmailconnector.send_email.SendEmail.create_connection">create_connection() (gmailconnector.send_email.SendEmail method)</a>
</li>
<li><a href="index.html#gmailconnector.read_email.ReadEmail.create_ssl_connection">create_ssl_connection() (gmailconnector.read_email.ReadEmail method)</a>

Expand Down
22 changes: 14 additions & 8 deletions docs/index.html

Large diffs are not rendered by default.

Binary file modified docs/objects.inv
Binary file not shown.
Loading

0 comments on commit fe8b920

Please sign in to comment.