From ea7f2f9a5b3100577440f66786f5f0dbc946cb46 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 13 Nov 2024 14:40:09 +0100 Subject: [PATCH 01/12] fix: project metadata --- pyproject.toml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5a2f70dc1..92ffe5fa0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,10 @@ build-backend = "flit_core.buildapi" [project] name = "ansys-dyna-core" -version = "0.4.dev0" +version = "0.6.dev0" description = "Python interface to LS-DYNA Service" readme = "README.rst" -requires-python = ">=3.10,<4" +requires-python = ">=3.11,<4" license = { file = "LICENSE" } authors = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }] maintainers = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }] @@ -19,10 +19,9 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = ["ansys-dpf-core>=0.7.2", @@ -84,10 +83,10 @@ doc = [ name = "ansys.dyna.core" [project.urls] -Source = "https://github.com/pyansys/pydyna" +Source = "https://github.com/ansys/pydyna" Homepage = "https://dyna.docs.pyansys.com" Documentation = "https://dyna.docs.pyansys.com" -Tracker = "https://github.com/pyansys/pydyna/issues" +Tracker = "https://github.com/ansys/pydyna/issues" [tool.black] line-length = 120 From d49aa2dce94eab58cd8eb1b7f021b86a29b0e4a7 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 13 Nov 2024 14:41:01 +0100 Subject: [PATCH 02/12] fix: python versions in tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 49fa9b95a..44341f4f8 100644 --- a/tox.ini +++ b/tox.ini @@ -9,9 +9,9 @@ isolated_build_env = build [testenv] description = Checks for project testing with desired extras basepython = - test310: python3.10 test311: python3.11 test312: python3.12 + test313: python3.13 {style,tests,doc}: python3 passenv = * setenv = From 4549981e450e132577adfa23e92e0ad9ce59e977 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 13 Nov 2024 14:43:15 +0100 Subject: [PATCH 03/12] fix: python versions in CI/CD workflows --- .github/workflows/ci_cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 79690cc84..c999d1266 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -14,7 +14,7 @@ on: - main env: - MAIN_PYTHON_VERSION: '3.10' + MAIN_PYTHON_VERSION: '3.11' PACKAGE_NAME: 'ansys-dyna-core' PACKAGE_NAMESPACE: 'ansys.dyna.core' DOCUMENTATION_CNAME: "dyna.docs.pyansys.com" @@ -180,7 +180,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - python-version: ['3.10', '3.11', '3.12'] + python-version: [3.11', '3.12', '3.13'] steps: - uses: ansys/actions/build-wheelhouse@v8 with: From 123ac5e82d8fa7b0d7865a74c3897e6cca2d9670 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 13 Nov 2024 15:04:54 +0100 Subject: [PATCH 04/12] ci: configure changelog --- .github/workflows/ci_cd.yml | 16 ++++++++++- .github/workflows/label.yml | 12 +++++++++ CHANGELOG.md | 3 +++ doc/changelog/template | 17 ++++++++++++ doc/source/changelog.rst | 8 ++++++ doc/source/conf.py | 1 + doc/source/index.rst | 1 + pyproject.toml | 53 +++++++++++++++++++++++++++++++++++++ 8 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md create mode 100644 doc/changelog/template create mode 100644 doc/source/changelog.rst diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index c999d1266..b08dff970 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -26,6 +26,20 @@ concurrency: jobs: + update-changelog: + name: "Update CHANGELOG (on release)" + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: ansys/actions/doc-deploy-changelog@v8 + with: + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} + bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} + code-style: name: "Code style" runs-on: ubuntu-latest @@ -288,7 +302,7 @@ jobs: release: name: Release project if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - needs: [build-library] + needs: [update-changelog, build-library] runs-on: ubuntu-latest steps: - name: "Release to the public PyPI repository" diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index e8ce38351..3a5d37bd9 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -89,3 +89,15 @@ jobs: - [maintenance](https://github.com/pyansys/pyDyna/pulls?q=label%3Amaintenance+) - [release](https://github.com/pyansys/pyDyna/pulls?q=label%3Arelease+) - [testing](https://github.com/pyansys/pyDyna/pulls?q=label%Atesting+) + + changelog-fragment: + name: "Create changelog fragment" + needs: [commenter] + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: ansys/actions/doc-changelog@v8 + with: + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..2c2fb726e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +This project uses [towncrier](https://towncrier.readthedocs.io/). Changes for +the upcoming release can be found in +[doc/source/changelog.rst](doc/source/changelog.rst). diff --git a/doc/changelog/template b/doc/changelog/template new file mode 100644 index 000000000..c5fe4e7da --- /dev/null +++ b/doc/changelog/template @@ -0,0 +1,17 @@ +{% if sections[""] %} +{% for category, val in definitions.items() if category in sections[""] %} + +{{ definitions[category]['name'] }} +{% set underline = '^' * definitions[category]['name']|length %} +{{ underline }} + +{% for text, values in sections[""][category].items() %} +- {{ text }} {{ values|join(', ') }} +{% endfor %} + +{% endfor %} +{% else %} +No significant changes. + + +{% endif %} diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst new file mode 100644 index 000000000..20b237681 --- /dev/null +++ b/doc/source/changelog.rst @@ -0,0 +1,8 @@ +Release notes +############# + +This document contains the release notes for the PyDyna project. + +.. vale off + +.. towncrier release notes start diff --git a/doc/source/conf.py b/doc/source/conf.py index d11a77e53..baa7ef965 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -96,6 +96,7 @@ # Read link all targets from file with open("links.rst") as f: rst_epilog += f.read() +linkcheck_exclude_documents = ["changelog"] inheritance_graph_attrs = dict(rankdir="RL", size='"8.0, 10.0"', fontsize=14, ratio="compress") inheritance_node_attrs = dict(shape="ellipse", fontsize=14, height=0.75, color="dodgerblue1", style="filled") diff --git a/doc/source/index.rst b/doc/source/index.rst index cd15737ae..20946991c 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -18,3 +18,4 @@ PyDYNA documentation |version| examples/index {% endif %} contributing + changelog diff --git a/pyproject.toml b/pyproject.toml index 92ffe5fa0..67e4d8412 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -108,3 +108,56 @@ show_missing = true minversion = "7.1" addopts = "-ra --cov=ansys.dyna.core --cov-report html:.cov/html --cov-report xml:.cov/xml --cov-report term -vv" testpaths = ["tests"] + +[tool.towncrier] +directory = "doc/changelog" +filename = "doc/source/changelog.rst" +template = "doc/changelog/template" +start_string = ".. towncrier release notes start\n" +title_format = "`{version} `_ - {project_date}" +issue_format = "`#{issue} `_" + +[[tool.towncrier.type]] +directory = "added" +name = "Added" +showcontent = true + +[[tool.towncrier.type]] +directory = "dependencies" +name = "Dependencies" +showcontent = true + +[[tool.towncrier.type]] +directory = "documentation" +name = "Documentation" +showcontent = true + +[[tool.towncrier.type]] +directory = "fixed" +name = "Fixed" +showcontent = true + +[[tool.towncrier.type]] +directory = "maintenance" +name = "Maintenance" +showcontent = true + +[[tool.towncrier.type]] +directory = "miscellaneous" +name = "Miscellaneous" +showcontent = true + +[[tool.towncrier.type]] +directory = "documentation" +name = "Documentation" +showcontent = true + +[[tool.towncrier.type]] +directory = "maintenance" +name = "Maintenance" +showcontent = true + +[[tool.towncrier.type]] +directory = "test" +name = "Test" +showcontent = true From 877837d176f9cf1cd62bcba9ea541412922c5059 Mon Sep 17 00:00:00 2001 From: Mohamed Koubaa Date: Wed, 13 Nov 2024 07:38:42 -0600 Subject: [PATCH 05/12] add devcontainer (#612) Co-authored-by: Mohamed Koubaa Co-authored-by: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> --- .devcontainer/devcontainer.json | 40 +++++++++++++++++++++++++++++++++ .devcontainer/welcome.rst | 5 +++++ tests/test_perf.py | 2 +- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/welcome.rst diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..56a2d66fd --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,40 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "echo 'Installing dependencies...' && pip3 install -e '.[test,codegen]' && pip3 install pre-commit && pre-commit install --install-hooks", + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" + + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VSCode. + "vscode": { + "openFiles": [ + ".devcontainer/welcome.rst" + ], + "extensions": [ + "ms-python.python" + ], + "settings": { + "terminal.integrated.defaultProfile.linux": "bash", + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true + } + } + } +} diff --git a/.devcontainer/welcome.rst b/.devcontainer/welcome.rst new file mode 100644 index 000000000..70403f3c9 --- /dev/null +++ b/.devcontainer/welcome.rst @@ -0,0 +1,5 @@ +Welcome to VSCode DevContainer! +=============================== + +This Devcontainer has been specifically set for developing and/or documenting PyDyna. + diff --git a/tests/test_perf.py b/tests/test_perf.py index b52569697..190f4ee6e 100644 --- a/tests/test_perf.py +++ b/tests/test_perf.py @@ -45,7 +45,7 @@ def _gen_nodes(count): def write1(s: io.StringIO, nodes: kwd.Node): - """Write the keyword with the implementation that is built into dynalib""" + """Write the keyword with the implementation that is built into PyDyna.""" nodes.write(s) return s From 91af32c37bc5d0344f0d9af362736698ca85bad6 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Wed, 13 Nov 2024 14:58:47 +0100 Subject: [PATCH 06/12] fix: pyproject.toml metadata (#614) --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 67e4d8412..b25319fbf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "ansys-dyna-core" version = "0.6.dev0" description = "Python interface to LS-DYNA Service" readme = "README.rst" -requires-python = ">=3.11,<4" +requires-python = ">=3.10,<4" license = { file = "LICENSE" } authors = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }] maintainers = [{ name = "ANSYS, Inc.", email = "pyansys.core@ansys.com" }] @@ -19,9 +19,9 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", ] dependencies = ["ansys-dpf-core>=0.7.2", From 7afb822deea860adfc63fab70715cdfd391fec36 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 13 Nov 2024 15:11:22 +0100 Subject: [PATCH 07/12] fix: restore python 3.10 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 44341f4f8..49fa9b95a 100644 --- a/tox.ini +++ b/tox.ini @@ -9,9 +9,9 @@ isolated_build_env = build [testenv] description = Checks for project testing with desired extras basepython = + test310: python3.10 test311: python3.11 test312: python3.12 - test313: python3.13 {style,tests,doc}: python3 passenv = * setenv = From 661308e0ffecd327ba73a24b9355fce5c59689dd Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 13 Nov 2024 15:12:13 +0100 Subject: [PATCH 08/12] fix: restore python 3.10 --- .github/workflows/ci_cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b08dff970..3d43441c8 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -14,7 +14,7 @@ on: - main env: - MAIN_PYTHON_VERSION: '3.11' + MAIN_PYTHON_VERSION: '3.10' PACKAGE_NAME: 'ansys-dyna-core' PACKAGE_NAMESPACE: 'ansys.dyna.core' DOCUMENTATION_CNAME: "dyna.docs.pyansys.com" @@ -194,7 +194,7 @@ jobs: fail-fast: false matrix: os: [windows-latest, ubuntu-latest] - python-version: [3.11', '3.12', '3.13'] + python-version: ['3.10', '3.11', '3.12'] steps: - uses: ansys/actions/build-wheelhouse@v8 with: From f763bcb479aa02e0f610869c60158a062f8d030e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADnez?= <28702884+jorgepiloto@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:46:24 +0100 Subject: [PATCH 09/12] fix: add enable vale Co-authored-by: Kerry McAdams <58492561+klmcadams@users.noreply.github.com> --- doc/source/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 20b237681..a1e16f545 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -6,3 +6,5 @@ This document contains the release notes for the PyDyna project. .. vale off .. towncrier release notes start + +.. vale on From 0717f92e8e41bbd668fb5402fc86e310fb881538 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 13 Nov 2024 16:48:31 +0100 Subject: [PATCH 10/12] ci: check pr-title --- .github/workflows/ci_cd.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 3d43441c8..90eed396b 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -40,9 +40,20 @@ jobs: bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} + pr-name: + if: github.event_name == 'pull_request' + name: Check the name of the PR + runs-on: ubuntu-latest + steps: + - name: Check commit name + uses: ansys/actions/check-pr-title@v8 + with: + token: ${{ secrets.GITHUB_TOKEN }} + code-style: name: "Code style" runs-on: ubuntu-latest + needs: pr-name steps: - uses: ansys/actions/code-style@v8 with: @@ -81,6 +92,7 @@ jobs: doc-style: name: "Documentation style" runs-on: ubuntu-latest + needs: pr-name steps: - name: PyAnsys documentation style checks uses: ansys/actions/doc-style@v8 From 6c25c393e7c5d3778a475c9ba2d74ad3e17f7a9e Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 13 Nov 2024 16:57:19 +0100 Subject: [PATCH 11/12] fix: use bot for changelog fragment --- .github/workflows/label.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 3a5d37bd9..5df2b1d5d 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -101,3 +101,6 @@ jobs: - uses: ansys/actions/doc-changelog@v8 with: token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} + bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} + From e6bd3f8cc54b3c8d2f1a93613374d30ab27d6570 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Wed, 13 Nov 2024 15:58:12 +0000 Subject: [PATCH 12/12] chore: adding changelog file 613.added.md [dependabot-skip] --- doc/changelog/613.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog/613.added.md diff --git a/doc/changelog/613.added.md b/doc/changelog/613.added.md new file mode 100644 index 000000000..56c7872b4 --- /dev/null +++ b/doc/changelog/613.added.md @@ -0,0 +1 @@ +feat: changelog actions \ No newline at end of file