Skip to content

Commit c4df632

Browse files
committed
Merge branch 'main' into fix/deserialize-object
2 parents da2735e + b100f55 commit c4df632

34 files changed

+1059
-1003
lines changed

.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[flake8]
2+
exclude = venv, __init__.py, doc/_build, .venv
3+
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403
4+
ignore = E501
5+
count = True
6+
max-complexity = 10
7+
max-line-length = 100
8+
statistics = True

.github/workflows/ci_cd.yml

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,14 @@ on:
1212
- main
1313

1414
jobs:
15-
style:
16-
name: Style Check
17-
runs-on: ubuntu-latest
18-
15+
code-style:
16+
name: "Code style"
17+
runs-on: windows-latest
1918
steps:
20-
- uses: actions/checkout@v4
21-
22-
- name: Setup Python
23-
uses: actions/setup-python@v5
24-
with:
25-
python-version: '3.10'
26-
27-
- name: Install kerberos headers
28-
run: |
29-
sudo apt-get update
30-
sudo apt install libkrb5-dev
31-
32-
- name: Install tox
33-
run: |
34-
pip install 'tox<4' poetry --disable-pip-version-check
35-
36-
- name: Lint project
37-
run: |
38-
tox -e lint
19+
- uses: ansys/actions/code-style@v5
20+
with:
21+
python-version: "3.10"
22+
skip-install: "false"
3923

4024
docs-style:
4125
name: Documentation Style Check
@@ -75,7 +59,7 @@ jobs:
7559

7660
steps:
7761
- uses: actions/checkout@v4
78-
62+
7963
- name: Configure host kerberos
8064
run: |
8165
apt update
@@ -91,7 +75,7 @@ jobs:
9175
9276
- name: Test with tox
9377
run: tox -- --with-kerberos
94-
78+
9579
- name: Upload coverage report
9680
uses: codecov/codecov-action@v3
9781
if: ${{ github.actor != 'dependabot[bot]' }}
@@ -109,7 +93,7 @@ jobs:
10993
uses: actions/setup-python@v5
11094
with:
11195
python-version: '3.10'
112-
96+
11397
- name: Install kerberos headers
11498
run: |
11599
sudo apt-get update
@@ -142,7 +126,7 @@ jobs:
142126
uses: actions/setup-python@v5
143127
with:
144128
python-version: '3.10'
145-
129+
146130
- name: Install kerberos headers
147131
run: |
148132
sudo apt-get update
@@ -179,7 +163,7 @@ jobs:
179163

180164
Release:
181165
if: contains(github.ref, 'refs/tags')
182-
needs: [build, test, style, docs]
166+
needs: [build, test, code-style, docs]
183167
runs-on: ubuntu-latest
184168
steps:
185169
- name: Set up Python
@@ -188,7 +172,7 @@ jobs:
188172
python-version: '3.10'
189173

190174
- uses: actions/checkout@v4
191-
175+
192176
# used for documentation deployment
193177
- name: Get Bot Application Token
194178
id: get_workflow_token

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
repos:
2+
3+
- repo: https://github.com/psf/black
4+
rev: 24.2.0
5+
hooks:
6+
- id: black
7+
8+
- repo: https://github.com/pycqa/isort
9+
rev: 5.12.0
10+
hooks:
11+
- id: isort
12+
13+
- repo: https://github.com/PyCQA/flake8
14+
rev: 6.0.0
15+
hooks:
16+
- id: flake8
17+
18+
- repo: https://github.com/codespell-project/codespell
19+
rev: v2.2.4
20+
hooks:
21+
- id: codespell
22+
args: ["--ignore-words", "doc/styles/Vocab/ANSYS/accept.txt", "--skip", "poetry.lock"]
23+
24+
- repo: https://github.com/pre-commit/pre-commit-hooks
25+
rev: v4.4.0
26+
hooks:
27+
- id: check-yaml
28+
- id: debug-statements
29+
- id: check-merge-conflict
30+
- id: trailing-whitespace
31+
- repo: https://github.com/pycqa/pydocstyle
32+
rev: 6.3.0
33+
hooks:
34+
- id: pydocstyle
35+
additional_dependencies: [tomli]
36+
files: "^(src/)"
37+
38+
- repo: local
39+
hooks:
40+
- id: mypy-code
41+
name: "mypy: checks on code"
42+
entry: "python -m mypy"
43+
language: system
44+
types: [python]
45+
require_serial: true
46+
files: "^(src/)"

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Overview
22
--------
33

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

@@ -52,7 +52,7 @@ Authentication schemes
5252
----------------------
5353

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

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

doc/source/_templates/custom-module-template.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{ fullname | escape | underline}}
44

55
.. automodule:: {{ fullname }}
6-
6+
77
{% block attributes %}
88
{% if attributes %}
99
.. rubric:: Module Attributes

doc/source/conf.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
from ansys.openapi import common
1+
from datetime import datetime
22
import os
33
import sys
4-
from datetime import datetime
4+
55
from ansys_sphinx_theme import pyansys_logo_black
66

7+
from ansys.openapi import common
8+
79
# -- Project information -----------------------------------------------------
810

911
project = "ansys.openapi.common"
@@ -92,7 +94,7 @@
9294
#
9395
# This is also used if you do content translation via gettext catalogs.
9496
# Usually you set "language" from the command line for these cases.
95-
language = 'en'
97+
language = "en"
9698

9799
# List of patterns, relative to source directory, that match files and
98100
# directories to ignore when looking for source files.
@@ -120,8 +122,8 @@
120122
"show_breadcrumbs": True,
121123
"additional_breadcrumbs": [
122124
("PyAnsys Documentation", "https://docs.pyansys.com"),
123-
("Shared Components", "https://shared.docs.pyansys.com")
124-
]
125+
("Shared Components", "https://shared.docs.pyansys.com"),
126+
],
125127
}
126128

127129
# -- Options for HTMLHelp output ---------------------------------------------

doc/source/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Overall guidance on contributing to a PyAnsys library appears in the
77
`Contributing <https://dev.docs.pyansys.com/overview/contributing.html>`_ topic
88
in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar
99
with this guide before attempting to contribute to OpenAPI-Common.
10-
10+
1111
The following contribution information is specific to OpenAPI-Common.
1212

1313

doc/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The client is now ready and available for use with an OpenAPI client.
4646
Authentication schemes
4747
----------------------
4848
OpenAPI-Common supports API servers configured with no authentication, API keys,
49-
client certificates, and basic authentication.
49+
client certificates, and basic authentication.
5050

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

0 commit comments

Comments
 (0)