Skip to content

add breadcrumb and pre-commit #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Feb 23, 2022
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
exclude = build, doc/source/conf.py
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403
count = True
max-complexity = 10
max-line-length = 100
statistics = True
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
insecure-external-code-execution: allow
schedule:
interval: "daily"
labels:
- "maintenance"
- "dependencies"
38 changes: 29 additions & 9 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,24 @@ on:
- main

jobs:
pre-commit:
name: Pre-commit checks
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install pre-commit requirements
run: |
pip install pre-commit~=2.16.0

- name: Run pre-commit
run: |
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )

docs_build:
runs-on: ubuntu-latest

Expand All @@ -26,6 +44,16 @@ jobs:
make -C doc html SPHINXOPTS="-W"
touch doc/build/html/.nojekyll
echo "dev.docs.pyansys.com" > doc/build/html/CNAME

- name: Deploy to gh-pages on main
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
token: ${{ secrets.github_token }}
branch: gh-pages
folder: docs/build/html
clean: true
single-commit: true

- name: Build PDF Documentation
run: |
Expand Down Expand Up @@ -64,17 +92,9 @@ jobs:
- name: Display structure of downloaded files
run: ls -R

- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
token: ${{ secrets.github_token }}
branch: gh-pages
folder: HTML-Documentation
clean: true
single-commit: true

- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
./*PDF*/*.pdf
21 changes: 0 additions & 21 deletions .github/workflows/style.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
repos:
- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
- id: black
exclude: "^({{cookiecutter.project_slug}}/)"
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.6.0
hooks:
- id: reorder-python-imports
args: ["--py37-plus"]
exclude: "^({{cookiecutter.project_slug}}/)"
- repo: https://gitlab.com/PyCQA/flake8
rev: 3.9.2
hooks:
- id: flake8
exclude: "^({{cookiecutter.project_slug}}/)"
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
args: [--ignore-words=ignore_words.txt, -S \*.pyc\,\*.xml\,\*.txt\,\*.gif\,\*.png\,\*.jpg\,\*.js\,\*.html\,\*.doctree\,\*.ttf\,\*.woff\,\*.woff2\,\*.eot\,\*.mp4\,\*.inv\,\*.pickle\,\*.ipynb\,flycheck\*\,./.git/\*\,./.hypothesis/\*\,\*.yml\,./doc/build/\*\,./doc/images/\*\,./dist/\*\,\*~\,.hypothesis\*\,./doc/source/examples/\*\,\*cover\,\*.dat\,\*.mac]
49 changes: 30 additions & 19 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,39 @@
"""Sphinx documentation configuration file for the pyansys developer's guide."""
from datetime import datetime

from pyansys_sphinx_theme import __version__, pyansys_logo_black
from pyansys_sphinx_theme import __version__
from pyansys_sphinx_theme import pyansys_logo_black

# Project information
project = 'PyAnsys Developers Guide'
project = "PyAnsys Developer's Guide"
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
author = "Ansys Inc."
release = version = '0.2.dev0'
release = version = "0.2.dev0"

html_logo = pyansys_logo_black
html_theme = 'pyansys_sphinx_theme'
html_theme = "pyansys_sphinx_theme"

html_theme_options = {
"github_url": "https://github.com/pyansys/about",
"show_prev_next": False
"github_url": "https://github.com/pyansys/dev-guide",
"show_prev_next": False,
"show_breadcrumbs": True,
"additional_breadcrumbs": [
("PyAnsys", "https://docs.pyansys.com/"),
],
}

# necessary for proper breadcrumb title
html_short_title = html_title = project

# Sphinx extensions
extensions = [
"sphinx_copybutton",
'sphinx_toolbox.collapse',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
"sphinx_toolbox.collapse",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
]

# Intersphinx mapping
Expand All @@ -38,22 +47,24 @@
}

# The suffix(es) of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

latex_elements = {}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc,
f'pyansys_dev_guide_v{version}.tex',
"PyAnsys Developer's Guide",
author,
'manual'),
(
master_doc,
f"pyansys_dev_guide_v{version}.tex",
"PyAnsys Developer's Guide",
author,
"manual",
),
]


Expand Down
8 changes: 4 additions & 4 deletions doc/source/documentation_style/sample_func.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
def func(arg1, arg2):
"""Summary line <should be only one line>.

Extended description of the function. The extended description,
which can span multiple lines, should provide a general overview
Extended description of the function. The extended description,
which can span multiple lines, should provide a general overview
of the function.

.. warning::
Use the ``.. warning::`` directive within the docstring for any
warnings that need to be explicitly stated. For example, you
want to include a warning for a method that is to be deprecated
warnings that need to be explicitly stated. For example, you
want to include a warning for a method that is to be deprecated
in the next release.

Parameters
Expand Down
Loading