Skip to content

Commit

Permalink
Merge branch 'main' into fix/deserialize-object
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy-Grigg committed Feb 20, 2024
2 parents da2735e + b100f55 commit c4df632
Show file tree
Hide file tree
Showing 34 changed files with 1,059 additions and 1,003 deletions.
8 changes: 8 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[flake8]
exclude = venv, __init__.py, doc/_build, .venv
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403
ignore = E501
count = True
max-complexity = 10
max-line-length = 100
statistics = True
42 changes: 13 additions & 29 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,14 @@ on:
- main

jobs:
style:
name: Style Check
runs-on: ubuntu-latest

code-style:
name: "Code style"
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install kerberos headers
run: |
sudo apt-get update
sudo apt install libkrb5-dev
- name: Install tox
run: |
pip install 'tox<4' poetry --disable-pip-version-check
- name: Lint project
run: |
tox -e lint
- uses: ansys/actions/code-style@v5
with:
python-version: "3.10"
skip-install: "false"

docs-style:
name: Documentation Style Check
Expand Down Expand Up @@ -75,7 +59,7 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Configure host kerberos
run: |
apt update
Expand All @@ -91,7 +75,7 @@ jobs:
- name: Test with tox
run: tox -- --with-kerberos

- name: Upload coverage report
uses: codecov/codecov-action@v3
if: ${{ github.actor != 'dependabot[bot]' }}
Expand All @@ -109,7 +93,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install kerberos headers
run: |
sudo apt-get update
Expand Down Expand Up @@ -142,7 +126,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install kerberos headers
run: |
sudo apt-get update
Expand Down Expand Up @@ -179,7 +163,7 @@ jobs:

Release:
if: contains(github.ref, 'refs/tags')
needs: [build, test, style, docs]
needs: [build, test, code-style, docs]
runs-on: ubuntu-latest
steps:
- name: Set up Python
Expand All @@ -188,7 +172,7 @@ jobs:
python-version: '3.10'

- uses: actions/checkout@v4

# used for documentation deployment
- name: Get Bot Application Token
id: get_workflow_token
Expand Down
46 changes: 46 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
repos:

- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black

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

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args: ["--ignore-words", "doc/styles/Vocab/ANSYS/accept.txt", "--skip", "poetry.lock"]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: debug-statements
- id: check-merge-conflict
- id: trailing-whitespace
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
additional_dependencies: [tomli]
files: "^(src/)"

- repo: local
hooks:
- id: mypy-code
name: "mypy: checks on code"
entry: "python -m mypy"
language: system
types: [python]
require_serial: true
files: "^(src/)"
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Overview
--------

OpenAPI-Common is intended for use with the custom code generation
template in the `PyAnsys project <https://github.com/pyansys>`_.
template in the `PyAnsys project <https://github.com/pyansys>`_.
It provides the source code for an authentication-aware
client for OpenAPI client libraries.

Expand Down Expand Up @@ -52,7 +52,7 @@ Authentication schemes
----------------------

OpenAPI-Common supports API servers configured with no authentication, API keys,
client certificates, and basic authentication schemes.
client certificates, and basic authentication schemes.

Windows users can also use Windows Integrated Authentication to connect to Kerberos-enabled
APIs with their Windows credentials and to NTLM where it is supported.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/_templates/custom-module-template.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{ fullname | escape | underline}}

.. automodule:: {{ fullname }}

{% block attributes %}
{% if attributes %}
.. rubric:: Module Attributes
Expand Down
12 changes: 7 additions & 5 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from ansys.openapi import common
from datetime import datetime
import os
import sys
from datetime import datetime

from ansys_sphinx_theme import pyansys_logo_black

from ansys.openapi import common

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

project = "ansys.openapi.common"
Expand Down Expand Up @@ -92,7 +94,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -120,8 +122,8 @@
"show_breadcrumbs": True,
"additional_breadcrumbs": [
("PyAnsys Documentation", "https://docs.pyansys.com"),
("Shared Components", "https://shared.docs.pyansys.com")
]
("Shared Components", "https://shared.docs.pyansys.com"),
],
}

# -- Options for HTMLHelp output ---------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Overall guidance on contributing to a PyAnsys library appears in the
`Contributing <https://dev.docs.pyansys.com/overview/contributing.html>`_ topic
in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar
with this guide before attempting to contribute to OpenAPI-Common.

The following contribution information is specific to OpenAPI-Common.


Expand Down
2 changes: 1 addition & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The client is now ready and available for use with an OpenAPI client.
Authentication schemes
----------------------
OpenAPI-Common supports API servers configured with no authentication, API keys,
client certificates, and basic authentication.
client certificates, and basic authentication.

Windows users can also use Windows Integrated Authentication to connect to Kerberos-enabled
APIs with their Windows credentials and to NTLM where it is supported.
Expand Down
Loading

0 comments on commit c4df632

Please sign in to comment.