Skip to content

Commit 8e43620

Browse files
maint: Tech review (#9)
Co-authored-by: Roberto Pastor Muela <[email protected]>
1 parent 71a037c commit 8e43620

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1479
-242
lines changed

.github/labeler.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
documentation:
2+
- changed-files:
3+
- any-glob-to-any-file: ['doc/source/**/*', 'README.md']
4+
5+
maintenance:
6+
- changed-files:
7+
- any-glob-to-any-file: ['.github/**/*', 'pyproject.toml', '.pre-commit-config.yaml']
8+
9+
testing:
10+
- changed-files:
11+
- any-glob-to-any-file: ['tests/*']

.github/labels.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
- name: bug
2+
description: Something isn't working
3+
color: d42a34
4+
5+
- name: dependencies
6+
description: Related with project dependencies
7+
color: ffc0cb
8+
9+
- name: documentation
10+
description: Improvements or additions to documentation
11+
color: 0677ba
12+
13+
- name: enhancement
14+
description: New features or code improvements
15+
color: FFD827
16+
17+
- name: good first issue
18+
description: Easy to solve for newcomers
19+
color: 62ca50
20+
21+
- name: maintenance
22+
description: Package and maintenance related
23+
color: f78c37
24+
25+
- name: release
26+
description: Anything related to an incoming release
27+
color: ffffff
28+
29+
- name: testing
30+
description: Anything related to testing
31+
color: 5802B8
32+
33+
- name: graphics
34+
description: Anything related to graphics
35+
color: 5903A8
36+
37+
- name: triage
38+
description: Need some assessment
39+
color: f78a50
40+
41+
- name: top priority
42+
description: Must be fixed promptly
43+
color: ab8a50
44+

.github/workflows/ci_cd.yml

Lines changed: 72 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99

1010
env:
1111
MAIN_PYTHON_VERSION: '3.12'
12+
DOCUMENTATION_CNAME: expert-adventure-nvnoo1y.pages.github.io
13+
PACKAGE_NAME: allie-flowkit-python
1214

1315
concurrency:
1416
group: ${{ github.workflow }}-${{ github.ref }}
@@ -24,38 +26,75 @@ jobs:
2426
runs-on: ubuntu-latest
2527
steps:
2628
- name: "Run PyAnsys code style checks"
27-
uses: ansys/actions/code-style@v6
29+
uses: ansys/actions/code-style@v7
30+
31+
smoke-tests:
32+
name: Build and Smoke tests
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
os: [ubuntu-latest, windows-latest, macos-latest]
38+
python-version: ['3.10', '3.11', '3.12']
39+
should-release:
40+
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
41+
exclude:
42+
- should-release: false
43+
os: macos-latest
44+
steps:
45+
- name: Build wheelhouse and perform smoke test
46+
uses: ansys/actions/build-wheelhouse@v7
47+
with:
48+
library-name: ${{ env.PACKAGE_NAME }}
49+
operating-system: ${{ matrix.os }}
50+
python-version: ${{ matrix.python-version }}
51+
52+
docs-style:
53+
name: Documentation Style Check
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: PyAnsys documentation style checks
57+
uses: ansys/actions/doc-style@v7
58+
with:
59+
token: ${{ secrets.GITHUB_TOKEN }}
60+
61+
docs-build:
62+
name: Documentation Build
63+
runs-on: ubuntu-latest
64+
needs: [docs-style]
65+
steps:
66+
67+
- name: "Run Ansys documentation building action"
68+
uses: ansys/actions/doc-build@v7
69+
with:
70+
add-pdf-html-docs-as-assets: true
71+
72+
upload_dev_docs:
73+
name: Upload dev documentation
74+
if: github.ref == 'refs/heads/main'
75+
runs-on: ubuntu-latest
76+
needs: [docs-build]
77+
steps:
78+
- name: Deploy the latest documentation
79+
uses: ansys/actions/doc-deploy-dev@v7
80+
with:
81+
cname: ${{ env.DOCUMENTATION_CNAME }}
82+
token: ${{ secrets.GITHUB_TOKEN }}
2883

2984
tests:
3085
name: "Tests"
3186
runs-on: ${{ matrix.os }}
32-
needs: [code-style]
87+
needs: [smoke-tests]
3388
strategy:
3489
matrix:
3590
os: [ubuntu-latest, windows-latest]
3691
python-version: ['3.9', '3.12']
3792
fail-fast: false
3893
steps:
39-
- name: Checkout code
40-
uses: actions/checkout@v4
41-
42-
- name: Set up Python ${{ matrix.python-version }}
43-
uses: actions/setup-python@v5
44-
with:
45-
python-version: ${{ matrix.python-version }}
46-
47-
- name: Install dependencies
48-
run: |
49-
python -m pip install --upgrade pip
50-
pip install -r requirements.txt
5194

5295
- name: Testing
53-
uses: ansys/actions/tests-pytest@v6
96+
uses: ansys/actions/tests-pytest@v7
5497
timeout-minutes: 12
55-
with:
56-
checkout: false
57-
skip-install: true
58-
pytest-extra-args: "--cov=ansys.allie.flowkit.python --cov-report=term --cov-report=html:.cov/html --cov-report=xml:.cov/coverage.xml"
5998

6099
- name: Upload coverage results (HTML)
61100
uses: actions/upload-artifact@v4
@@ -68,7 +107,7 @@ jobs:
68107
release:
69108
name: "Release project"
70109
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
71-
needs: [code-style]
110+
needs: [docs-build, tests]
72111
runs-on: ubuntu-latest
73112
steps:
74113
- name: Checkout code
@@ -79,6 +118,19 @@ jobs:
79118
with:
80119
generate_release_notes: true
81120

121+
upload_docs_release:
122+
name: Upload release documentation
123+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
124+
runs-on: ubuntu-latest
125+
needs: [release]
126+
steps:
127+
- name: Deploy the stable documentation
128+
uses: ansys/actions/doc-deploy-stable@v7
129+
with:
130+
cname: ${{ env.DOCUMENTATION_CNAME }}
131+
token: ${{ secrets.GITHUB_TOKEN }}
132+
133+
82134
release-docker:
83135
name : Generate Docker release
84136
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@ dist/
4040
config.yaml
4141

4242
# Do not ignore config.yaml in the configs/ directory
43-
!configs/config.yaml
43+
!configs/config.yaml
44+
45+
# Docs
46+
doc/_build/
47+
doc/source/api/

.pre-commit-config.yaml

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 23.12.1
2+
- repo: https://github.com/adamchainz/blacken-docs
3+
rev: 1.18.0
44
hooks:
5-
- id: black
6-
7-
- repo: https://github.com/pycqa/isort
8-
rev: 5.13.2
9-
hooks:
10-
- id: isort
11-
12-
- repo: https://github.com/PyCQA/flake8
13-
rev: 6.1.0
14-
hooks:
15-
- id: flake8
16-
17-
- repo: https://github.com/pycqa/pydocstyle
18-
rev: 6.3.0
19-
hooks:
20-
- id: pydocstyle
21-
args: ["--ignore=D205,D100,D213,D203"]
22-
exclude: examples
23-
additional_dependencies: [toml]
5+
- id: blacken-docs
6+
additional_dependencies: [black==23.12.1]
247

258
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.5.0
9+
rev: v4.6.0
2710
hooks:
2811
- id: check-merge-conflict
2912
- id: debug-statements
3013
- id: check-yaml
3114
- id: trailing-whitespace
3215

3316
- repo: https://github.com/python-jsonschema/check-jsonschema
34-
rev: 0.27.3
17+
rev: 0.29.1
18+
hooks:
19+
- id: check-github-workflows
20+
21+
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: v0.5.7
24+
hooks:
25+
- id: ruff
26+
args: [--fix]
27+
- id: ruff-format
28+
29+
- repo: https://github.com/ansys/pre-commit-hooks
30+
rev: v0.4.3
3531
hooks:
36-
- id: check-github-workflows
32+
- id: add-license-headers
33+
files: '(src|examples|tests|docker)/.*\.(py)|\.(proto)'
34+
args:
35+
- --start_year=2024

AUTHORS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This is the list of allie-flowkit-python's significant contributors.
2+
#
3+
# This file does not necessarily list everyone who has contributed code.
4+
#
5+
# For contributions made under a Corporate CLA, the organization is
6+
# added to this file.
7+
#
8+
# If you have contributed to the repository and wish to be added to this file
9+
# please submit a request.
10+
#
11+
#
12+
ANSYS, Inc.

CODE_OF_CONDUCT.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Contributor covenant code of conduct
2+
3+
## Pledge
4+
5+
In the interest of fostering an open and welcoming environment,
6+
all contributors and maintainers pledge to making participation
7+
in the Ansys project and community a harassment-free experience
8+
for everyone, regardless of age, body size, disability, ethnicity,
9+
sex characteristics, gender identity and expression, level of
10+
experience, education, socioeconomic status, nationality, personal
11+
appearance, race, religion, or sexual identity and orientation.
12+
13+
## Standards
14+
15+
Examples of behavior that contribute to creating a positive environment
16+
include:
17+
18+
* Using welcoming and inclusive language
19+
* Being respectful of differing viewpoints and experiences
20+
* Gracefully accepting constructive criticism
21+
* Focusing on what is best for the community
22+
* Showing empathy towards other community members
23+
24+
Examples of unacceptable behavior by participants include:
25+
26+
* The use of sexualized language or imagery and unwelcome sexual
27+
attention or advances
28+
* Trolling, insulting/derogatory comments, and personal or political attacks
29+
* Public or private harassment
30+
* Publishing others' private information, such as a physical or electronic
31+
address, without explicit permission
32+
* Other conduct which could reasonably be considered inappropriate in a
33+
professional setting
34+
35+
## Responsibilities
36+
37+
Project maintainers are responsible for clarifying the standards of acceptable
38+
behavior and are expected to take appropriate and fair corrective action in
39+
response to any instances of unacceptable behavior.
40+
41+
Project maintainers have the right and responsibility to remove, edit, or reject
42+
comments, commits, code, wiki edits, issues, and other contributions that are
43+
not aligned to this Code of Conduct, or to ban temporarily or permanently any
44+
contributor for other behaviors that they deem inappropriate, threatening,
45+
offensive, or harmful.
46+
47+
## Scope
48+
49+
This Code of Conduct applies both within project spaces and in public spaces
50+
when an individual is representing the project or its community. Examples of
51+
representing a project or community include using an official project email
52+
address, posting using an official social media account, or acting as an appointed
53+
representative at an online or offline event. Representation of a project may be
54+
further defined and clarified by project maintainers.
55+
56+
## Attribution
57+
58+
This code of conduct is adapted from the [Contributor Covenant][homepage],
59+
version 1.4, available at
60+
https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
61+
62+
[homepage]: https://www.contributor-covenant.org
63+
64+
For answers to common questions about this code of conduct, see
65+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Contribute
2+
3+
Overall guidance on contributing to a PyAnsys library appears in the
4+
*Contributing* topic in the *[PyAnsys developer's guide]*. Ensure that you
5+
are thoroughly familiar with this guide before attempting to contribute to
6+
allie-flowkit-python. For contributing to this project, please refer to the
7+
[Contributing] section of this project's documentation.
8+
9+
[PyAnsys Developer's Guide]: https://dev.docs.pyansys.com/index.html
10+
[Contributing]: expert-adventure-nvnoo1y.pages.github.io/dev/contributing.html

CONTRIBUTORS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Contributors
2+
3+
## Project Lead or Owner
4+
5+
* [Laura Sanchez-Gallego Kadri](https://github.com/laurasgkadri98)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 ANSYS, Inc. and/or its affiliates.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9+
of the Software, and to permit persons to whom the Software is furnished to do
10+
so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)