Skip to content

Commit

Permalink
REFACT: final changes related to OSS (#135)
Browse files Browse the repository at this point in the history
* MISC: add contributing.md

* MISC: add contributors.md

* MISC: update links to be public

* MISC: update project name

* MISC: rename var env to select backend

* CI: add actions to go public

Changes include:
- pdf build through make.bat (as well as html)
- smoke tests and wheel house
- doc indices in meiliserach

* MAINT: update project dev version

* DOC: remove grouping into latex files

* MISC: update latex lib

* CI: add step for pdf upload

* CI: fix wrong yaml format
  • Loading branch information
SMoraisAnsys authored Feb 2, 2024
1 parent 39b9b80 commit 75db4ce
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 117 deletions.
147 changes: 79 additions & 68 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYEDB_USE_LEGACY: '1'
PYEDB_USE_DOTNET: '1'
MAIN_PYTHON_VERSION: '3.10'
MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED: '3.9'
PACKAGE_NAME: 'pyedb'
Expand All @@ -28,7 +28,7 @@ concurrency:

jobs:

docs-style:
doc-style:
name: Documentation style check
runs-on: ubuntu-latest
steps:
Expand All @@ -39,24 +39,23 @@ jobs:
vale-config: "doc/.vale.ini"
vale-version: "2.29.6"

# TODO: uncomment once this repo is public
# smoke-tests:
# name: Build and Smoke tests
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, windows-latest]
# python-version: ['3.9', '3.10', '3.11']
# should-release:
# - ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
# steps:
# - name: Build wheelhouse and perform smoke test
# uses: ansys/actions/build-wheelhouse@v4
# with:
# library-name: ${{ env.PACKAGE_NAME }}
# operating-system: ${{ matrix.os }}
# python-version: ${{ matrix.python-version }}
smoke-tests:
name: Build and Smoke tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11']
should-release:
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
steps:
- name: Build wheelhouse and perform smoke test
uses: ansys/actions/build-wheelhouse@v5
with:
library-name: ${{ env.PACKAGE_NAME }}
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

# =================================================================================================
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Expand Down Expand Up @@ -179,26 +178,38 @@ jobs:
. .venv\Scripts\Activate.ps1
pip install pyaedt
# Run doc build, without creating the examples directory.
# NOTE: we have to add the examples file here since it won't be created as gallery is disabled on linux.
- name: Documentation Build
- name: Build the documentation (HTML)
run: |
. .venv\Scripts\Activate.ps1
sphinx-build -j auto -w build_errors.txt -N -b html -a doc/source doc/_build/html
.\.venv\Scripts\Activate.ps1
cd doc
.\make.bat html
- name: Build the documentation (PDF)
run: |
.\.venv\Scripts\Activate.ps1
cd doc
.\make.bat pdf
# Verify that sphinx generates no warnings
- name: Check for warnings
run: |
. .venv\Scripts\Activate.ps1
python doc/print_errors.py
- name: Upload Documentation
- name: Upload HTML Documentation artifact
uses: actions/upload-artifact@v4
with:
name: documentation-html
path: doc/_build/html
retention-days: 1

- name: Upload PDF Documentation artifact
uses: actions/upload-artifact@v4
with:
name: documentation-pdf
path: doc/_build/latex/*.pdf
retention-days: 7

package:
name: Package library
needs: [legacy-tests, docs-build]
Expand Down Expand Up @@ -233,20 +244,20 @@ jobs:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}

# doc-index-dev:
# name: "Deploy dev index docs"
# if: github.ref == 'refs/heads/main'
# runs-on: ubuntu-latest
# needs: upload-dev-docs
# steps:
# - name: "Deploy the latest documentation index"
# uses: ansys/actions/doc-deploy-index@v5
# with:
# cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
# index-name: pyedb-vdev
# host-url: ${{ env.MEILISEARCH_HOST_URL }}
# api-key: ${{ env.MEILISEARCH_API_KEY }}
# python-version: ${{ env.MAIN_PYTHON_VERSION }}
doc-index-dev:
name: "Deploy dev index docs"
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: upload-dev-docs
steps:
- name: "Deploy the latest documentation index"
uses: ansys/actions/doc-deploy-index@v5
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
index-name: pyedb-vdev
host-url: ${{ env.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}

upload-docs-release:
name: Upload release documentation
Expand All @@ -260,32 +271,32 @@ jobs:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}

# doc-index-stable:
# name: "Deploy stable docs index"
# runs-on: ubuntu-latest
# needs: upload-docs-release
# steps:
# - name: "Install Git and clone project"
# uses: actions/checkout@v4

# - name: "Install the package requirements"
# run: pip install -e .

# - name: "Get the version to PyMeilisearch"
# run: |
# VERSION=$(python -c "from pyedb import __version__; print('.'.join(__version__.split('.')[:2]))")
# VERSION_MEILI=$(python -c "from pyedb import __version__; print('-'.join(__version__.split('.')[:2]))")
# echo "Calculated VERSION: $VERSION"
# echo "Calculated VERSION_MEILI: $VERSION_MEILI"
# echo "VERSION=$VERSION" >> $GITHUB_ENV
# echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV

# - name: "Deploy the latest documentation index"
# uses: ansys/actions/doc-deploy-index@v5
# with:
# cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }}
# index-name: pyedb-v${{ env.VERSION_MEILI }}
# host-url: ${{ env.MEILISEARCH_HOST_URL }}
# api-key: ${{ env.MEILISEARCH_API_KEY }}
# python-version: ${{ env.MAIN_PYTHON_VERSION }}
doc-index-stable:
name: "Deploy stable docs index"
runs-on: ubuntu-latest
needs: upload-docs-release
steps:
- name: "Install Git and clone project"
uses: actions/checkout@v4

- name: "Install the package requirements"
run: pip install -e .

- name: "Get the version to PyMeilisearch"
run: |
VERSION=$(python -c "from pyedb import __version__; print('.'.join(__version__.split('.')[:2]))")
VERSION_MEILI=$(python -c "from pyedb import __version__; print('-'.join(__version__.split('.')[:2]))")
echo "Calculated VERSION: $VERSION"
echo "Calculated VERSION_MEILI: $VERSION_MEILI"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV
- name: "Deploy the latest documentation index"
uses: ansys/actions/doc-deploy-index@v5
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }}
index-name: pyedb-v${{ env.VERSION_MEILI }}
host-url: ${{ env.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}

2 changes: 1 addition & 1 deletion .github/workflows/nightly-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYEDB_USE_LEGACY: '1'
PYEDB_USE_DOTNET: '1'
PYEDB_CI_NO_DISPLAY: '1'
MAIN_PYTHON_VERSION_WINDOWS_SELFHOSTED: '3.9'
VTK_OSMESA: 'vtk-osmesa==9.2.20230527.dev0'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly-pyaedt-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:

env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYEDB_USE_LEGACY: '1'
PYEDB_USE_DOTNET: '1'

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing

We absolutely welcome any code contributions and we hope that this
guide will facilitate an understanding of the PyEDB code
repository. It is important to note that while the PyEDB software
package is maintained by ANSYS and any submissions will be reviewed
thoroughly before merging, we still seek to foster a community that can
support user questions and develop new features to make this software
a useful tool for all users. As such, we welcome and encourage any
questions or submissions to this repository.

For contributing to this project, please refer to the [PyAnsys Developer's Guide].

[PyAnsys Developer's Guide]: https://dev.docs.pyansys.com/index.html

## Directing Issues and Features Requests

For reporting bugs and proposing new features, please use the Issues tab instead of the Discussions tab. This will help us track and prioritize work in a more organized manner.

## Purpose of Discussions

The Discussions tab should primarily be used for general questions and discussions about the project. This could include discussions about potential improvements, the future direction of the project, brainstorming ideas, help with using the software, and other topics that don't exactly fit as an Issue.

Remember, maintaining distinct places for different types of interactions helps keep our project organized and moving forward in a coordinated manner.

## Modify the Code

Everyone can contribute to this project, irrespective of their level of expertise. Your diverse skills, perspectives, and experiences are valuable and we welcome them.

Here's a simple overview of how you can start making contributions:

**Fork the Repository:** "Forking" means creating a personal copy of this repository on your GitHub account.

**Clone the Repository:** After forking, you need to download the repository to your local machine. This can be done using the `git clone` command.

**Create a New Branch:** A branch is used to isolate your changes from the main project. You can create a new branch using the `git branch` command. Remember to switch to your new branch with the `git checkout` command.

**Commit Your Changes:** After making your changes, you need to "commit" them. A commit is a packaged set of alterations. Use `git add` to add your files to staging, and then `git commit -m "your message"` to commit them.

**Push Your Changes:** After committing your changes, "push" them to your forked repository on GitHub with `git push origin <branch-name>`.

**Create a Pull Request:** A Pull Request (PR) lets us know you have changes you think should be included in the main project. Go to your forked repository on GitHub and click on the 'Pull request' button.

Following these steps ensures that your contributions will be easily reviewed and potentially included in the project much faster.

Please don't get discouraged if you find these steps complex, we are here to help you throughout the process.

We hope these rules will make the Discussions section a better place for every contributor.
12 changes: 12 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contributors

## Project Lead

* [Simon Vandenbrouck](https://github.com/svandenb-dev)

## Individual Contributors

* [Hui Zhou](https://github.com/ring630)
* [Sébastien Morais](https://github.com/SMoraisAnsys)
* [Kathy Pippert](https://github.com/PipKat)

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,28 @@ combine 3D designs, or perform simulation postprocessing. EDB also supports 3D c
## Documentation and issues

Documentation for the latest stable release of PyEDB is hosted at
[PyEDB documentation](https://edb.docs.pyansys.com/version/dev/index.html).
[PyEDB documentation](https://edb.docs.pyansys.com/version/stable/index.html).
The documentation has five sections:

- `Getting started <https://edb.docs.pyansys.com/version/version/dev/getting_started/index.html#>`_: Describes
- `Getting started <https://edb.docs.pyansys.com/version/version/stable/getting_started/index.html#>`_: Describes
how to install PyEDB in user mode.
- `User guide <https:edb.docs.pyansys.com/version/version/dev/user_guide/index.html>`_: Describes how to
- `User guide <https:edb.docs.pyansys.com/version/version/stable/user_guide/index.html>`_: Describes how to
use PyEDB.
- `API reference <edb.docs.pyansys.com/version/version/dev/api/index.html>`_: Provides API member descriptions
- `API reference <edb.docs.pyansys.com/version/version/stable/api/index.html>`_: Provides API member descriptions
and usage examples.
- `Examples <https://edb.docs.pyansys.com/version/version/dev/examples/index.html>`_: Provides examples showing
- `Examples <https://edb.docs.pyansys.com/version/version/stable/examples/index.html>`_: Provides examples showing
end-to-end workflows for using PyEDB.
- `Contribute <https://edb.docs.pyansys.com/version/version/dev/contribute.html>`_: Describes how to install
- `Contribute <https://edb.docs.pyansys.com/version/version/stable/contribute.html>`_: Describes how to install
PyEDB in developer mode and how to contribute to this PyAnsys library.

In the upper right corner of the documentation's title bar, there is an option
for switching from viewing the documentation for the latest stable release
to viewing the documentation for the development version or previously
released versions.

On the [PyEDB Issues](https://github.com/ansys/pyansys-edb/issues) page, you can
On the [PyEDB Issues](https://github.com/ansys/pyedb/issues) page, you can
create issues to report bugs and request new features. On the
[PyEDB Discussions](https://github.com/ansys/pyansys-edb/discussions) page or the
[PyEDB Discussions](https://github.com/ansys/pyedb/discussions) page or the
[Discussions](https://discuss.ansys.com/) page on the Ansys Developer portal,
you can post questions, share ideas, and get community feedback.

Expand Down
22 changes: 18 additions & 4 deletions doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
if "%SPHINXOPTS%" == "" (
set SPHINXOPTS = -j auto -w build_errors.txt -N -q
)
set SOURCEDIR=source
set BUILDDIR=_build

if "%1" == "" goto help
if "%1" == "clean" goto clean
if "%1" == "pdf" goto pdf

%SPHINXBUILD% >NUL 2>NUL
Expand All @@ -29,14 +33,24 @@ if errorlevel 9009 (
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
:clean
rmdir /s /q %BUILDDIR% > /NUL 2>&1
for /d /r %SOURCEDIR% %%d in (_autosummary) do @if exist "%%d" rmdir /s /q "%%d"
goto end

:pdf
%SPHINXBUILD% -M latex %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
cd "%BUILDDIR%\latex"
for %%f in (*.tex) do (
pdflatex "%%f" --interaction=nonstopmode)
xelatex "%%f" --interaction=nonstopmode)
if NOT EXIST ansys-edb.pdf (
Echo "no pdf generated!"
exit /b 1)
Echo "pdf generated!"
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
popd
Loading

0 comments on commit 75db4ce

Please sign in to comment.