From 381adbe78290e2bbbd8a31a92600202b3f819161 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Garrido Date: Mon, 21 Nov 2022 10:26:47 +0100 Subject: [PATCH 1/6] MAINT: migrate requirements to pyproject.toml --- pyproject.toml | 13 +++++++++++++ requirements/requirements_build.txt | 2 -- requirements/requirements_tests.txt | 2 -- tox.ini | 6 ++---- 4 files changed, 15 insertions(+), 8 deletions(-) delete mode 100644 requirements/requirements_build.txt delete mode 100644 requirements/requirements_tests.txt diff --git a/pyproject.toml b/pyproject.toml index 8c685b1c07..df5fa1df57 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,6 +26,19 @@ dependencies = [ "importlib-metadata >=4.0", ] +[project.optional-dependencies] +tests = [ + "pytest==7.0.1", + "pytest-cov==4.0.0", +] +doc = [ + "ansys-sphinx-theme==0.7.1", + "numpydoc==1.5.0", + "sphinx==5.3.0", + "sphinx-autoapi==2.0.0", + "sphinx-copybutton==0.5.1", +] + [tool.flit.module] name = "ansys.stk.core" diff --git a/requirements/requirements_build.txt b/requirements/requirements_build.txt deleted file mode 100644 index a966ab4aeb..0000000000 --- a/requirements/requirements_build.txt +++ /dev/null @@ -1,2 +0,0 @@ -build==0.9.0 -twine>=3.8.0 diff --git a/requirements/requirements_tests.txt b/requirements/requirements_tests.txt deleted file mode 100644 index c204493991..0000000000 --- a/requirements/requirements_tests.txt +++ /dev/null @@ -1,2 +0,0 @@ -pytest>=7.0.1 -pytest-cov==4.0.0 diff --git a/tox.ini b/tox.ini index 1b16e6071f..f1e3896be0 100644 --- a/tox.ini +++ b/tox.ini @@ -19,8 +19,7 @@ basepython = setenv = PYTHONUNBUFFERED = yes cov: PYTEST_EXTRA_ARGS = --cov=ansys.stk --cov-report=term --cov-report=xml:.cov/xml --cov-report=html:.cov/html -deps = - -r{toxinidir}/requirements/requirements_tests.txt +extras = tests commands = pytest {env:PYTEST_MARKERS:} {env:PYTEST_EXTRA_ARGS:} {posargs:-vv} @@ -35,7 +34,6 @@ commands = [testenv:doc] description = Check if documentation generates properly -deps = - -r{toxinidir}/requirements/requirements_doc.txt +extras = doc commands = sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxworkdir}/doc_out" --color -vW -b html -j auto From 5189afd387512dbd818e6045191f1b67c134f08f Mon Sep 17 00:00:00 2001 From: Jorge Martinez Garrido Date: Mon, 21 Nov 2022 12:24:14 +0100 Subject: [PATCH 2/6] CI: migrate to pyansys/actions --- .github/workflows/ci_cd.yml | 291 +++++++++++------------------------- doc/source/conf.py | 40 +++-- pyproject.toml | 2 +- 3 files changed, 121 insertions(+), 212 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 16958687f6..bcf38070ce 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -9,8 +9,9 @@ on: env: MAIN_PYTHON_VERSION: '3.10' - PACKAGE_NAME: 'ansys-stk-core' - IMPORT_NAME: 'ansys.stk.core' + LIBRARY_NAME: 'ansys-stk-core' + LIBRARY_NAMESPACE: 'ansys.stk.core' + DOCUMENTATION_CNAME: 'stk.docs.pyansys.com' concurrency: @@ -19,230 +20,116 @@ concurrency: jobs: - style: - name: Code style + code-style: + name: "Code style checks" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: + - name: "Run code style checks" + uses: pyansys/actions/code-style@v1 + with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip flit tox - - name: Test with tox - run: tox -e style doc-style: - name: Documentation style + name: "Documentation style checks" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Running Vale - uses: errata-ai/vale-action@reviewdog - env: - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} - with: - files: doc - reporter: github-pr-check - level: error - filter_mode: nofilter - fail_on_error: true - vale_flags: "--config=doc/.vale.ini" - - tests: - name: Tests - needs: [style] - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest, ubuntu-latest] - cfg: - - {python-version: "3.6", toxenv: "py36"} - - {python-version: "3.7", toxenv: "py37"} - - {python-version: "3.8", toxenv: "py38"} - - {python-version: "3.9", toxenv: "py39"} - - {python-version: "3.10", toxenv: "py310-cov"} - fail-fast: false - - steps: - - name: Clone repository - uses: actions/checkout@v3 + - name: "Run code style checks" + uses: pyansys/actions/doc-style@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Python ${{ matrix.cfg.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.cfg.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip tox - - name: Test with tox - run: tox -e ${{ matrix.cfg.toxenv }} - - - name: Install package - run: | - python -m pip install -r requirements/requirements_build.txt - python -m pip install . - - name: Store version - run: | - echo "::set-output name=PACKAGE_VERSION::$(python -c "from ${{ env.IMPORT_NAME }} import __version__; print(__version__)")" - id: version - - - name: Generate wheelhouse - run: | - pip wheel . -w wheelhouse - - name: Zip wheelhouse - uses: vimtor/action-zip@v1 - with: - files: wheelhouse - dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PACKAGE_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.cfg.python-version }}.zip - - - name: Upload Wheelhouse - uses: actions/upload-artifact@v3 - with: - name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PACKAGE_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.cfg.python-version }} - path: '*.zip' - retention-days: 7 - - - name: Upload coverage results as artifacts - uses: actions/upload-artifact@v3 - if: | - (matrix.cfg.python-version == env.MAIN_PYTHON_VERSION) && - (runner.os == 'Linux') - with: - name: HTML-Coverage - path: .cov/html - retention-days: 7 - - docs: - name: Documentation + doc-build: + name: "Build project documentation" runs-on: ubuntu-latest - needs: [doc-style] + needs: doc-style steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 + - name: "Building project documentation" + uses: pyansys/actions/doc-build@v1 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - - name: Install dependencies - run: | - sudo apt-get update && sudo apt-get install pandoc - python -m pip install --upgrade pip tox - - name: Generate the documentation with tox - run: | - tox -e doc - - name: Upload documentation as artifact - uses: actions/upload-artifact@v3 - with: - name: HTML-Documentation - path: .tox/doc_out - retention-days: 7 - - build: - name: Build library - needs: [tests, docs] + doc-deploy-dev: + name: "Deploy developers documentation" runs-on: ubuntu-latest + if: github.event_name == 'push' && contains(github.ref, 'refs/heads/main') + needs: doc-build steps: - - uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 + - name: "Deploy development documentation" + uses: pyansys/actions/doc-deploy-dev@v1 with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - name: Install dependencies and build the library - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements/requirements_build.txt - python -m build - python -m twine check dist/* + cname: ${{ env.DOCUMENTATION_CNAME }} + token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload wheel and binaries as artifacts - uses: actions/upload-artifact@v3 - with: - name: ${{ env.PACKAGE_NAME }}-packages - path: dist/ - retention-days: 7 - - release_pkg: - name: Release project - if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - needs: [build] + doc-deploy-stable: + name: "Deploy stable documentation" runs-on: ubuntu-latest + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + needs: doc-deploy-dev steps: - - name: Set up Python - uses: actions/setup-python@v4 + - name: "Deploy stable documentation" + uses: pyansys/actions/doc-deploy-stable@v1 with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} + cname: ${{ env.DOCUMENTATION_CNAME }} + token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/download-artifact@v3 - - - name: Display structure of downloaded files - run: ls --recursive - - # TODO: Explicit state which files are pushed to private PyPI - # - name: Upload to private PyPi - # run: | - # pip install twine - # python -m twine upload --skip-existing ./**/*.whl - # python -m twine upload --skip-existing ./**/*.tar.gz - # env: - # TWINE_USERNAME: PAT - # TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} - # TWINE_REPOSITORY_URL: https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload - - # TODO: Explicit state which files are released in GitHub - # - name: Release in GitHub - # uses: softprops/action-gh-release@v1 - # with: - # files: | - # ./**/*.whl - # ./**/*.tar.gz - # ./**/*.zip - - release_docs: - name: Release documentation - if: (github.event_name == 'push' && contains(github.ref, 'refs/tags')) || (github.ref == 'refs/heads/main') - runs-on: ubuntu-latest - needs: [build] + tests: + name: "Code tests and coverage" + runs-on: ${{ matrix.os }} + needs: code-style + strategy: + matrix: + os: [windows-latest, ubuntu-latest] + python-version: ['3.7', '3.8', '3.9', '3.10'] + fail-fast: false steps: - - uses: actions/checkout@v3 + - name: "Generate pytest arguments according to environment" + run: echo "PYTEST_EXTRA_ARGS=$(if [ "$matrix.python-version" == "$env.MAIN_PYTHON_VERSION" ]; then echo '--cov=ansys.stk --cov-report=term --cov-report=xml:.cov/coverage.xml --cov-report=html:.cov/html'; else echo '')" >> $GITHUB_ENV - - uses: actions/download-artifact@v3 + - name: "Run test suite with pytest" + uses: pyansys/actions/tests-pytest@v1 with: - name: HTML-Documentation - path: HTML-Documentation + python-version: ${{ matrix.python-version }} + pytest-extra-args: ${{ env.PYTEST_EXTRA_ARGS }} - - name: Get Bot Application Token - id: get_workflow_token - uses: peter-murray/workflow-application-token-action@v2 - with: - application_id: ${{ secrets.BOT_APPLICATION_ID }} - application_private_key: ${{ secrets.BOT_APPLICATION_PRIVATE_KEY }} + # - name: "Upload coverage results" + # uses: actions/upload-artifact@v3 + # with: + # name: coverage-html + # path: .cov/html + # retention-days: 7 - - name: Deploy documentation to pystk-dev-docs repository - if: github.ref == 'refs/heads/main' - uses: JamesIves/github-pages-deploy-action@v4.4.1 - with: - repository-name: pyansys/pystk-dev-docs - token: ${{ steps.get_workflow_token.outputs.token }} - branch: gh-pages - folder: HTML-Documentation - clean: true - single-commit: true - - - name: Deploy documentation to pystk-docs repository - if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - uses: JamesIves/github-pages-deploy-action@v4.4.1 + build-library: + name: "Build library artifacts" + runs-on: ubuntu-latest + needs: [doc-deploy-stable, tests] + steps: + - name: "Build library source and wheel artifacts" + uses: pyansys/actions/build-library@v1 with: - repository-name: pyansys/pystk-docs - token: ${{ steps.get_workflow_token.outputs.token }} - branch: gh-pages - folder: HTML-Documentation - clean: true - single-commit: true + library-name: ${{ env.LIBRARY_NAME }} + + # release: + # name: "Release to private and public PyPI and to GitHub" + # if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + # runs-on: ubuntu-latest + # needs: [build-library] + # steps: + + # - name: "Release to the private PyPI repository" + # uses: pyansys/actions/release-pypi-private@v1 + # with: + # library-name: ${{ env.LIBRARY_NAME }} + # twine-username: "__token__" + # twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} + + # - name: "Release to the public PyPI repository" + # uses: pyansys/actions/release-pypi-public@main + # with: + # library-name: ${{ env.LIBRARY_NAME }} + # twine-username: "__token__" + # twine-token: ${{ secrets.PYPI_TOKEN }} + + # - name: "Release to GitHub" + # uses: pyansys/actions/release-github@main + # with: + # library-name: ${{ env.LIBRARY_NAME }} diff --git a/doc/source/conf.py b/doc/source/conf.py index 61cc284bf6..6d2f546e6d 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,27 +1,49 @@ """Sphinx documentation configuration file.""" from datetime import datetime +import os -from ansys_sphinx_theme import pyansys_logo_black as logo +from ansys_sphinx_theme import ansys_favicon, pyansys_logo_black + +from ansys.stk.core import __version__ # Project information project = "ansys-stk-core" copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved" author = "ANSYS, Inc." -release = version = "0.1.dev0" +release = version = __version__ +cname = os.getenv("DOCUMENTATION_CNAME", "stk.docs.pyansys.com") -# Select desired logo, theme, and declare the html title -html_logo = logo -html_theme = "ansys_sphinx_theme" -html_short_title = html_title = "pystk-core" -# specify the location of your github repo +def get_version_match(semver): + """Evaluate the version match for the multi-documentation.""" + if semver.endswith("dev0"): + return "dev" + major, minor, _ = semver.split(".") + return ".".join([major, minor]) + + +# Configure the HTML theme +html_logo = pyansys_logo_black +html_theme = "ansys_sphinx_theme" +html_short_title = html_title = "PySTK" +html_context = { + "github_user": "pyansys", + "github_repo": "pystk", + "github_version": "main", + "doc_path": "doc/source", +} html_theme_options = { - "github_url": "https://github.com/pyansys/pystk-core", + "github_url": "https://github.com/pyansys/pystk", "show_prev_next": False, "show_breadcrumbs": True, "additional_breadcrumbs": [ ("PyAnsys", "https://docs.pyansys.com/"), ], + "switcher": { + "json_url": f"https://{cname}/release/versions.json", + "version_match": get_version_match(__version__), + }, + "navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"], } # Sphinx extensions @@ -87,4 +109,4 @@ #'exclude-members': '__weakref__' } autodoc_class_signature = "separated" -autodoc_mock_imports = ["tkinter"] \ No newline at end of file +autodoc_mock_imports = ["tkinter"] diff --git a/pyproject.toml b/pyproject.toml index df5fa1df57..182712c58b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,9 +33,9 @@ tests = [ ] doc = [ "ansys-sphinx-theme==0.7.1", + "enum-tools[sphinx]==0.9.0.post1", "numpydoc==1.5.0", "sphinx==5.3.0", - "sphinx-autoapi==2.0.0", "sphinx-copybutton==0.5.1", ] From 148f18f18d87215b467ec83582c0d7dd259e92a5 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Garrido Date: Wed, 30 Nov 2022 09:50:27 +0100 Subject: [PATCH 3/6] MAIN: update doc requirements --- pyproject.toml | 4 ++-- requirements/requirements_doc.txt | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 requirements/requirements_doc.txt diff --git a/pyproject.toml b/pyproject.toml index 182712c58b..af36775dc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,11 +32,11 @@ tests = [ "pytest-cov==4.0.0", ] doc = [ - "ansys-sphinx-theme==0.7.1", - "enum-tools[sphinx]==0.9.0.post1", + "ansys-sphinx-theme==0.7.2", "numpydoc==1.5.0", "sphinx==5.3.0", "sphinx-copybutton==0.5.1", + "enum-tools[sphinx]==0.9.0.post1", ] [tool.flit.module] diff --git a/requirements/requirements_doc.txt b/requirements/requirements_doc.txt deleted file mode 100644 index b51ba2711c..0000000000 --- a/requirements/requirements_doc.txt +++ /dev/null @@ -1,5 +0,0 @@ -ansys-sphinx-theme==0.7.2 -numpydoc==1.5.0 -sphinx==5.3.0 -sphinx-copybutton==0.5.1 -enum-tools[sphinx]==0.9.0.post1 From 3bf99ce7f6c56c92ec039c570fe9f512ada1af44 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Garrido Date: Wed, 30 Nov 2022 09:52:46 +0100 Subject: [PATCH 4/6] DOC: adapt to latest sphinx theme --- doc/Makefile | 8 +++++++- doc/make.bat | 12 ++++++++++-- doc/source/conf.py | 32 +++++++++++++++----------------- 3 files changed, 32 insertions(+), 20 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index d5066f423c..57f21f3b9a 100755 --- a/doc/Makefile +++ b/doc/Makefile @@ -21,6 +21,12 @@ help: # Customized clean due to examples gallery clean: - rm -rf $(BUILDDIR)/* + rm -rf $(BUILDDIR) rm -rf $(SOURCEDIR)/examples find . -type d -name "_autosummary" -exec rm -rf {} + + +# Customized pdf fov svg format images +pdf: + @$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true + (test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1 diff --git a/doc/make.bat b/doc/make.bat index fbf400507e..42241b7fac 100644 --- a/doc/make.bat +++ b/doc/make.bat @@ -1,4 +1,5 @@ -@ECHO OFF +@echo OFF +setlocal pushd %~dp0 @@ -12,6 +13,7 @@ set BUILDDIR=_build if "%1" == "" goto help if "%1" == "clean" goto clean +if "%1" == "pdf" goto pdf %SPHINXBUILD% >NUL 2>NUL if errorlevel 9009 ( @@ -30,12 +32,18 @@ if errorlevel 9009 ( goto end :clean -rmdir /s /q %BUILDDIR% > /NUL 2>&1 +rmdir /s /q %BUILDDIR% > /NUL 2>&1 for /d /r %SOURCEDIR% %%d in (_autosummary) do @if exist "%%d" rmdir /s /q "%%d" goto end :help %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +:pdf + %SPHINXBUILD% -M latex %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + cd "%BUILDDIR%\latex" + for %%f in (*.tex) do ( + pdflatex "%%f" --interaction=nonstopmode) + :end popd diff --git a/doc/source/conf.py b/doc/source/conf.py index 6d2f546e6d..196818b268 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -2,7 +2,11 @@ from datetime import datetime import os -from ansys_sphinx_theme import ansys_favicon, pyansys_logo_black +from ansys_sphinx_theme import ( + ansys_favicon, + get_version_match, + pyansys_logo_black, +) from ansys.stk.core import __version__ @@ -13,17 +17,9 @@ release = version = __version__ cname = os.getenv("DOCUMENTATION_CNAME", "stk.docs.pyansys.com") - -def get_version_match(semver): - """Evaluate the version match for the multi-documentation.""" - if semver.endswith("dev0"): - return "dev" - major, minor, _ = semver.split(".") - return ".".join([major, minor]) - - # Configure the HTML theme html_logo = pyansys_logo_black +html_favicon = ansys_favicon html_theme = "ansys_sphinx_theme" html_short_title = html_title = "PySTK" html_context = { @@ -34,7 +30,7 @@ def get_version_match(semver): } html_theme_options = { "github_url": "https://github.com/pyansys/pystk", - "show_prev_next": False, + "show_prev_next": True, "show_breadcrumbs": True, "additional_breadcrumbs": [ ("PyAnsys", "https://docs.pyansys.com/"), @@ -68,8 +64,10 @@ def get_version_match(semver): # Consider enabling numpydoc validation. See: # https://numpydoc.readthedocs.io/en/latest/validation.html# numpydoc_validate = True -numpydoc_validation_checks = set() # numpydoc validation is turned off due to performance (see PR#44) -#numpydoc_validation_checks = { +numpydoc_validation_checks = ( + set() +) # numpydoc validation is turned off due to performance (see PR#44) +# numpydoc_validation_checks = { # "GL06", # Found unknown section # "GL07", # Sections are in the wrong order. # # "GL08", # The object does not have a docstring @@ -82,7 +80,7 @@ def get_version_match(semver): # # "SS05", # Summary must start with infinitive verb, not third person # "RT02", # The first line of the Returns section should contain only the # # type, unless multiple values are being returned" -#} +# } # Path to static files html_static_path = ["_static"] @@ -91,7 +89,7 @@ def get_version_match(semver): templates_path = ["_templates"] # Directories excluded when looking for source files -exclude_patterns = ['api/generated/*.rst'] +exclude_patterns = ["api/generated/*.rst"] # The suffix(es) of source filenames. source_suffix = ".rst" @@ -102,10 +100,10 @@ def get_version_match(semver): # autodoc configuration autodoc_default_options = { #'members': 'var1, var2', - 'member-order': 'alphabetical', + "member-order": "alphabetical", #'special-members': '__init__', "show-inheritance": True, - 'undoc-members': True, + "undoc-members": True, #'exclude-members': '__weakref__' } autodoc_class_signature = "separated" From 8e06b11a9e807c023385e74a9649d433118a8677 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Garrido Date: Wed, 30 Nov 2022 10:53:22 +0100 Subject: [PATCH 5/6] CI: improve test matrix --- .github/workflows/ci_cd.yml | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index bcf38070ce..5a0d9ef6f2 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -73,30 +73,34 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} tests: - name: "Code tests and coverage" + name: "Test Python ${{ matrix.cfg.python-version }} in ${{ matrix.os }} " runs-on: ${{ matrix.os }} needs: code-style strategy: matrix: os: [windows-latest, ubuntu-latest] - python-version: ['3.7', '3.8', '3.9', '3.10'] + cfg: + - {python-version: '3.7', extra-args: ''} + - {python-version: '3.8', extra-args: ''} + - {python-version: '3.9', extra-args: ''} + - {python-version: '3.10', extra-args: '--cov=ansys.stk --cov-report=term --cov-report=html:.cov/html'} + fail-fast: false steps: - - name: "Generate pytest arguments according to environment" - run: echo "PYTEST_EXTRA_ARGS=$(if [ "$matrix.python-version" == "$env.MAIN_PYTHON_VERSION" ]; then echo '--cov=ansys.stk --cov-report=term --cov-report=xml:.cov/coverage.xml --cov-report=html:.cov/html'; else echo '')" >> $GITHUB_ENV - name: "Run test suite with pytest" uses: pyansys/actions/tests-pytest@v1 with: - python-version: ${{ matrix.python-version }} - pytest-extra-args: ${{ env.PYTEST_EXTRA_ARGS }} - - # - name: "Upload coverage results" - # uses: actions/upload-artifact@v3 - # with: - # name: coverage-html - # path: .cov/html - # retention-days: 7 + python-version: ${{ matrix.cfg.python-version }} + pytest-extra-args: ${{ matrix.cfg.extra-args }} + + - name: "Upload coverage results" + uses: actions/upload-artifact@v3 + if: matrix.cfg.python-version == env.MAIN_PYTHON_VERSION && matrix.os == 'ubuntu-latest' + with: + name: coverage-html + path: .cov/html + retention-days: 7 build-library: name: "Build library artifacts" From b4a19f113305b7bfd8309bf466f616a43244dcd4 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Garrido Date: Wed, 30 Nov 2022 15:57:35 +0100 Subject: [PATCH 6/6] CI: point dependabot to pyproject.toml --- .github/dependabot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1ddf1183fe..b5d1656aa1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,7 @@ version: 2 updates: - package-ecosystem: "pip" - directory: "/requirements" + directory: "/" schedule: interval: "daily" labels: