Skip to content

Commit 608ced0

Browse files
Merge branch 'main' into feat/add-tools-path
2 parents dbfb7ef + 2872a54 commit 608ced0

28 files changed

+1760
-47
lines changed

.github/workflows/cicd.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ on:
1212
env:
1313
PACKAGE_NAME: ansys-tools-common
1414
MAIN_PYTHON_VERSION: 3.13
15+
DOCUMENTATION_CNAME: bookish-adventure-16g5prl.pages.github.io
1516

1617
jobs:
1718
style:
1819
name: Code style
1920
runs-on: ubuntu-latest
2021
steps:
2122
- name: PyAnsys code style checks
22-
uses: ansys/actions/code-style@v9
23+
uses: ansys/actions/code-style@v10
2324
with:
2425
python-version: ${{ env.MAIN_PYTHON_VERSION }}
2526
smoke-tests:
@@ -32,7 +33,7 @@ jobs:
3233
python-version: ['3.10', '3.11', '3.12']
3334
steps:
3435
- name: Build wheelhouse and perform smoke test
35-
uses: ansys/actions/build-wheelhouse@v9
36+
uses: ansys/actions/build-wheelhouse@v10
3637
with:
3738
library-name: ${{ env.PACKAGE_NAME }}
3839
operating-system: ${{ matrix.os }}
@@ -48,32 +49,42 @@ jobs:
4849
ON_UBUNTU: true
4950

5051
steps:
51-
- uses: actions/checkout@v4
52-
- name: Setup Python
53-
uses: actions/setup-python@v5
52+
- name: Run tests
53+
uses: ansys/actions/tests-pytest@v10
5454
with:
5555
python-version: ${{ env.MAIN_PYTHON_VERSION }}
5656

57-
- name: Install library, with test extra
58-
run: python -m pip install .[tests]
59-
60-
- name: Unit testing
61-
run: |
62-
python -m pytest -vx --cov=${{ env.PACKAGE_NAMESPACE }} --cov-report=term --cov-report=xml:.cov/coverage.xml --cov-report=html:.cov/html
63-
64-
- name: Upload coverage reports to Codecov
65-
uses: codecov/codecov-action@v5
57+
doc-build:
58+
name: Build documentation
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Build documentation
62+
uses: ansys/actions/doc-build@v10
6663
with:
67-
files: .cov/coverage.xml
68-
64+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
65+
check-links: false # Delete after first release
6966

7067
package:
7168
name: Package library
7269
runs-on: ubuntu-latest
7370
needs: [smoke-tests]
7471
steps:
7572
- name: Build library source and wheel artifacts
76-
uses: ansys/actions/build-library@v9
73+
uses: ansys/actions/build-library@v10
7774
with:
7875
library-name: ${{ env.PACKAGE_NAME }}
79-
python-version: ${{ env.MAIN_PYTHON_VERSION }}
76+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
77+
78+
upload_dev_docs:
79+
name: Upload dev documentation
80+
if: github.ref == 'refs/heads/main'
81+
runs-on: ubuntu-latest
82+
needs: [doc-build]
83+
steps:
84+
- name: Deploy the latest documentation
85+
uses: ansys/actions/doc-deploy-dev@v10
86+
with:
87+
cname: ${{ env.DOCUMENTATION_CNAME }}
88+
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
89+
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
90+
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ instance/
6969
.scrapy
7070

7171
# Sphinx documentation
72-
docs/_build/
72+
doc/_build/
7373

7474
# PyBuilder
7575
.pybuilder/
@@ -172,4 +172,7 @@ cython_debug/
172172

173173
# PyPI configuration file
174174
.pypirc
175-
.vscode
175+
.vscode
176+
._build
177+
178+
doc/source/api

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To clone and install the latest *Ansys Tools* release in development mode, run
1515
these commands:
1616

1717
```bash
18-
git clone https://github.com/ansys/ansys-tools/
18+
git clone https://github.com/ansys/ansys-tools-common/
1919
cd ansys-tools
2020
python -m pip install --upgrade pip
2121
pip install -e .

README.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
Ansys tools
2-
============================
2+
===========
33
|pyansys| |python| |pypi| |MIT| |GH-CI| |pre-commit|
44

55
.. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
66
:target: https://docs.pyansys.com/
77
:alt: PyAnsys
88

9-
.. |python| image:: https://img.shields.io/pypi/pyversions/ansys-tools?logo=pypi
10-
:target: https://pypi.org/project/ansys-tools/
9+
.. |python| image:: https://img.shields.io/pypi/pyversions/ansys-tools-common?logo=pypi
10+
:target: https://pypi.org/project/ansys-tools-common/
1111
:alt: Python
1212

13-
.. |pypi| image:: https://img.shields.io/pypi/v/ansys-tools.svg?logo=python&logoColor=white
14-
:target: https://pypi.org/project/ansys-tools
13+
.. |pypi| image:: https://img.shields.io/pypi/v/ansys-tools-common.svg?logo=python&logoColor=white
14+
:target: https://pypi.org/project/ansys-tools-common
1515
:alt: PyPI
1616

1717
.. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
1818
:target: https://opensource.org/licenses/MIT
1919
:alt: MIT
2020

21-
.. |GH-CI| image:: https://github.com/ansys/ansys-tools/actions/workflows/ci_cd.yml/badge.svg
22-
:target: https://github.com/ansys/ansys-tools/actions/workflows/ci_cd.yml
21+
.. |GH-CI| image:: https://github.com/ansys-internal/ansys-tools-common/actions/workflows/cicd.yml/badge.svg
22+
:target: https://github.com/ansys-internal/ansys-tools-common/actions/workflows/cicd.yml
2323
:alt: GH-CI
2424

25-
.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/ansys/ansys-tools/main.svg
26-
:target: https://results.pre-commit.ci/latest/github/ansys/ansys-tools/main
25+
.. |pre-commit| image:: https://results.pre-commit.ci/badge/github/ansys/ansys-tools-common/main.svg
26+
:target: https://results.pre-commit.ci/latest/github/ansys/ansys-tools-common/main
2727
:alt: pre-commit.ci status
2828

2929
.. contents::
@@ -58,7 +58,7 @@ for switching from viewing the documentation for the latest stable release
5858
to viewing the documentation for the development version or previously
5959
released versions.
6060

61-
On the `Ansys tools Issues <https://github.com/ansys/ansys-tools/issues>`_
61+
On the `Ansys tools Issues <https://github.com/ansys/ansys-tools-common/issues>`_
6262
page, you can create issues to report bugs and request new features. On the
6363
`Discussions <https://discuss.ansys.com/>`_ page on the Ansys Developer portal,
6464
you can post questions, share ideas, and get community feedback.
@@ -71,6 +71,6 @@ question in an issue as described in the previous paragraph.
7171
License
7272
-------
7373

74-
The Ansys tools is licensed under the `MIT License <https://github.com/ansys/ansys-tools/blob/main/LICENSE>`_.
74+
Ansys tools is licensed under the `MIT License <https://github.com/ansys/ansys-tools-common/blob/main/LICENSE>`_.
7575

76-
The Ansys tools makes no commercial claim over Ansys whatsoever.
76+
Ansys tools makes no commercial claim over Ansys whatsoever.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% if sections[""] %}
2+
{% for category, val in definitions.items() if category in sections[""] %}
3+
4+
### {{ definitions[category]['name'] }}
5+
6+
{% for text, values in sections[""][category].items() %}
7+
- {{ text }} {{ values|join(', ') }}
8+
{% endfor %}
9+
10+
{% endfor %}
11+
{% else %}
12+
No significant changes.
13+
14+
15+
{% endif %}

doc/make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ goto end
4949
cd "%BUILDDIR%\latex"
5050
for %%f in (*.tex) do (
5151
pdflatex "%%f" --interaction=nonstopmode)
52-
if NOT EXIST ansys-tools.pdf (
52+
if NOT EXIST ansys-tools-common.pdf (
5353
Echo "no pdf generated!"
5454
exit /b 1)
5555
Echo "pdf generated!"

doc/source/conf.py

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
"""Configuration file for the Sphinx documentation builder."""
2+
3+
from datetime import datetime
4+
import os
5+
6+
from ansys_sphinx_theme import (
7+
ansys_favicon,
8+
ansys_logo_white,
9+
ansys_logo_white_cropped,
10+
get_version_match,
11+
watermark,
12+
)
13+
14+
from ansys.tools.common import __version__
15+
16+
# Project information
17+
project = "ansys-tools-common"
18+
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
19+
author = "ANSYS, Inc."
20+
release = version = __version__
21+
cname = os.getenv("DOCUMENTATION_CNAME", default="tools.docs.pyansys.com")
22+
switcher_version = get_version_match(__version__)
23+
24+
html_theme = "ansys_sphinx_theme"
25+
html_short_title = html_title = "Ansys tools common"
26+
html_baseurl = f"https://{cname}/version/stable"
27+
28+
# specify the location of your github repo
29+
html_context = {
30+
"github_user": "ansys",
31+
"github_repo": "ansys-tools-common",
32+
"github_version": "main",
33+
"doc_path": "doc/source",
34+
}
35+
html_theme_options = {
36+
"logo": "pyansys",
37+
"switcher": {
38+
"json_url": f"https://{cname}/versions.json",
39+
"version_match": switcher_version,
40+
},
41+
"check_switcher": False,
42+
"github_url": "https://github.com/ansys/ansys-tools-common",
43+
"show_prev_next": False,
44+
"show_breadcrumbs": True,
45+
"collapse_navigation": True,
46+
"use_edit_page_button": True,
47+
"additional_breadcrumbs": [
48+
("PyAnsys", "https://docs.pyansys.com/"),
49+
],
50+
"icon_links": [
51+
{
52+
"name": "Support",
53+
"url": "https://github.com/ansys/ansys-tools-common/discussions",
54+
"icon": "fa fa-comment fa-fw",
55+
},
56+
{
57+
"name": "Download documentation in PDF",
58+
"url": f"https://{cname}/version/{switcher_version}/_static/assets/download/ansys-tools-common.pdf", # noqa: E501
59+
"icon": "fa fa-file-pdf fa-fw",
60+
},
61+
],
62+
"ansys_sphinx_theme_autoapi": {
63+
"project": project,
64+
"package_depth": 3,
65+
},
66+
"static_search": {
67+
"threshold": 0.5,
68+
"minMatchCharLength": 2,
69+
"ignoreLocation": True,
70+
},
71+
}
72+
73+
# Sphinx extensions
74+
extensions = [
75+
"sphinx.ext.intersphinx",
76+
"sphinx_copybutton",
77+
"sphinx_design",
78+
"ansys_sphinx_theme.extension.autoapi",
79+
]
80+
81+
# numpydoc configuration
82+
numpydoc_show_class_members = False
83+
numpydoc_xref_param_type = True
84+
85+
# Consider enabling numpydoc validation. See:
86+
# https://numpydoc.readthedocs.io/en/latest/validation.html#
87+
numpydoc_validate = True
88+
numpydoc_validation_checks = {
89+
"GL06", # Found unknown section
90+
"GL07", # Sections are in the wrong order.
91+
# "GL08", # The object does not have a docstring
92+
"GL09", # Deprecation warning should precede extended summary
93+
"GL10", # reST directives {directives} must be followed by two colons
94+
"SS01", # No summary found
95+
"SS02", # Summary does not start with a capital letter
96+
# "SS03", # Summary does not end with a period
97+
"SS04", # Summary contains heading whitespaces
98+
# "SS05", # Summary must start with infinitive verb, not third person
99+
"RT02", # The first line of the Returns section should contain only the
100+
# type, unless multiple values are being returned"
101+
}
102+
103+
html_favicon = ansys_favicon
104+
# Add any paths that contain templates here, relative to this directory.
105+
templates_path = ["_templates"]
106+
107+
# The suffix(es) of source filenames.
108+
source_suffix = {
109+
".rst": "restructuredtext",
110+
".md": "markdown",
111+
}
112+
113+
typehints_defaults = "comma"
114+
# additional logos for the latex coverpage
115+
latex_additional_files = [watermark, ansys_logo_white, ansys_logo_white_cropped]

0 commit comments

Comments
 (0)