From ebeb1f32db19dbcf43777bbce55e02e70243cea3 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Tue, 30 Sep 2025 11:28:40 +0200 Subject: [PATCH 01/16] update release version to 4.0.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0abafd0cf..3f128242c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "OMPython" -version = "3.6.0" +version = "4.0.0" description = "OpenModelica-Python API Interface" readme = "README.md" authors = [ From 40511eb7025a5381c27ff80b169360dc78e76a53 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Tue, 30 Sep 2025 12:06:29 +0200 Subject: [PATCH 02/16] test only on windows --- .github/workflows/FMITest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/FMITest.yml b/.github/workflows/FMITest.yml index cfa0f9d82..80a764d41 100644 --- a/.github/workflows/FMITest.yml +++ b/.github/workflows/FMITest.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: python-version: ['3.12'] - os: ['ubuntu-latest', 'windows-latest'] + os: ['windows-latest'] omc-version: ['stable', 'nightly'] steps: From 5745e85a1f8f7782eb20ff5fddeb73bf9c12b5c7 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 3 Oct 2025 10:36:13 +0200 Subject: [PATCH 03/16] fix jenkins file --- .github/workflows/FMITest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/FMITest.yml b/.github/workflows/FMITest.yml index 80a764d41..cfa0f9d82 100644 --- a/.github/workflows/FMITest.yml +++ b/.github/workflows/FMITest.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: python-version: ['3.12'] - os: ['windows-latest'] + os: ['ubuntu-latest', 'windows-latest'] omc-version: ['stable', 'nightly'] steps: From f3ff55c9d62b43de5a68c4ccb455a8e3831bc79c Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 3 Oct 2025 11:39:19 +0200 Subject: [PATCH 04/16] add LICENSE file for pip package --- LICENSE | 26 ++++++++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..a10803e7e --- /dev/null +++ b/LICENSE @@ -0,0 +1,26 @@ + This project is part of OpenModelica. + + Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC), + c/o Linköpings universitet, Department of Computer and Information Science, + SE-58183 Linköping, Sweden. + + All rights reserved. + + THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE + GPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2. + ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES + RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3, + ACCORDING TO RECIPIENTS CHOICE. + + The OpenModelica software and the OSMC (Open Source Modelica Consortium) + Public License (OSMC-PL) are obtained from OSMC, either from the above + address, from the URLs: http://www.openmodelica.org or + http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica + distribution. GNU version 3 is obtained from: + http://www.gnu.org/copyleft/gpl.html. The New BSD License is obtained from: + http://www.opensource.org/licenses/BSD-3-Clause. + + This program is distributed WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS + EXPRESSLY SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE + CONDITIONS OF OSMC-PL. \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 3f128242c..14d509fa6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ authors = [ maintainers = [ {name = "Adeel Asghar", email = "adeel.asghar@liu.se"}, ] -license = "BSD-3-Clause OR LicenseRef-OSMC-PL-1.2 OR GPL-3.0-only" +license = { file = "LICENSE" } requires-python = ">=3.10" dependencies = [ "numpy", From 15968e5537cf38a011d89d821095364dcae59ea8 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 3 Oct 2025 11:42:42 +0200 Subject: [PATCH 05/16] disable nightly tests --- .github/workflows/FMITest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/FMITest.yml b/.github/workflows/FMITest.yml index cfa0f9d82..fefd76665 100644 --- a/.github/workflows/FMITest.yml +++ b/.github/workflows/FMITest.yml @@ -13,7 +13,7 @@ jobs: matrix: python-version: ['3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['stable', 'nightly'] + omc-version: ['stable'] steps: - uses: actions/checkout@v5 From 1ffd8db4e9ad83e44f85f1be7ab57f2159244634 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 3 Oct 2025 11:52:49 +0200 Subject: [PATCH 06/16] Fix LICENSE end-of-file formatting --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index a10803e7e..e8d699437 100644 --- a/LICENSE +++ b/LICENSE @@ -23,4 +23,4 @@ This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS EXPRESSLY SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE - CONDITIONS OF OSMC-PL. \ No newline at end of file + CONDITIONS OF OSMC-PL. From 1d3c3fbd7a51e40e48bf5bcd5bf7b4400810b29d Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 3 Oct 2025 12:07:27 +0200 Subject: [PATCH 07/16] disable docker test --- .github/workflows/FMITest.yml | 2 +- .github/workflows/Test.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/FMITest.yml b/.github/workflows/FMITest.yml index fefd76665..cfa0f9d82 100644 --- a/.github/workflows/FMITest.yml +++ b/.github/workflows/FMITest.yml @@ -13,7 +13,7 @@ jobs: matrix: python-version: ['3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['stable'] + omc-version: ['stable', 'nightly'] steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 164944004..2efd79365 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -14,7 +14,7 @@ jobs: matrix: python-version: ['3.10', '3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['stable'] + omc-version: ['stable', 'nightly'] steps: - uses: actions/checkout@v5 @@ -48,9 +48,9 @@ jobs: 'Modelica 4.0.0' - run: "omc --version" - - name: Pull OpenModelica docker image - if: runner.os != 'Windows' - run: docker pull openmodelica/openmodelica:v1.25.0-minimal + # - name: Pull OpenModelica docker image + # if: runner.os != 'Windows' + # run: docker pull openmodelica/openmodelica:v1.25.0-minimal - name: Run pytest uses: pavelzw/pytest-action@v2 From 0427785472391f692ec7eaa24ca05950a301e678 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 3 Oct 2025 13:12:22 +0200 Subject: [PATCH 08/16] check only nightly builds --- .github/workflows/FMITest.yml | 2 +- .github/workflows/Test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/FMITest.yml b/.github/workflows/FMITest.yml index cfa0f9d82..33d3a7829 100644 --- a/.github/workflows/FMITest.yml +++ b/.github/workflows/FMITest.yml @@ -13,7 +13,7 @@ jobs: matrix: python-version: ['3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['stable', 'nightly'] + omc-version: ['nightly'] steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 2efd79365..a85ff5207 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -14,7 +14,7 @@ jobs: matrix: python-version: ['3.10', '3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['stable', 'nightly'] + omc-version: ['nightly'] steps: - uses: actions/checkout@v5 From 4a61c9730324a4a1d4cc3bac71eaf5284e7dce7f Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 3 Oct 2025 13:29:05 +0200 Subject: [PATCH 09/16] enable docker test --- .github/workflows/Test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index a85ff5207..fb05cd65e 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -48,9 +48,9 @@ jobs: 'Modelica 4.0.0' - run: "omc --version" - # - name: Pull OpenModelica docker image - # if: runner.os != 'Windows' - # run: docker pull openmodelica/openmodelica:v1.25.0-minimal + - name: Pull OpenModelica docker image + if: runner.os != 'Windows' + run: docker pull openmodelica/openmodelica:v1.25.0-minimal - name: Run pytest uses: pavelzw/pytest-action@v2 From 2a21850218171b482cb6f09d5f493a442e2028d7 Mon Sep 17 00:00:00 2001 From: arun3688 Date: Fri, 3 Oct 2025 14:28:39 +0200 Subject: [PATCH 10/16] enable omc stable version --- .github/workflows/Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index fb05cd65e..bb0d44651 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -14,7 +14,7 @@ jobs: matrix: python-version: ['3.10', '3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['nightly'] + omc-version: ['stable', 'nightly'] steps: - uses: actions/checkout@v5 From e93a7af4fd285696af8c0fee00e4d5fc40226732 Mon Sep 17 00:00:00 2001 From: Adeel Asghar Date: Fri, 10 Oct 2025 11:47:30 +0200 Subject: [PATCH 11/16] Update setup-openmodelica --- .github/workflows/FMITest.yml | 4 ++-- .github/workflows/Test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/FMITest.yml b/.github/workflows/FMITest.yml index 33d3a7829..7ecfffa86 100644 --- a/.github/workflows/FMITest.yml +++ b/.github/workflows/FMITest.yml @@ -13,12 +13,12 @@ jobs: matrix: python-version: ['3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['nightly'] + omc-version: ['stable', 'nightly'] steps: - uses: actions/checkout@v5 - name: "Set up OpenModelica Compiler" - uses: OpenModelica/setup-openmodelica@v1.0 + uses: OpenModelica/setup-openmodelica@v1.0.2 with: version: ${{ matrix.omc-version }} packages: | diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index bb0d44651..53cd12ab0 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -39,7 +39,7 @@ jobs: run: 'pre-commit run --all-files' - name: "Set up OpenModelica Compiler" - uses: OpenModelica/setup-openmodelica@v1.0 + uses: OpenModelica/setup-openmodelica@v1.0.2 with: version: ${{ matrix.omc-version }} packages: | From 13ce31fb26819bf6c32f98a4cc64b1d78e4ee413 Mon Sep 17 00:00:00 2001 From: Adeel Asghar Date: Fri, 10 Oct 2025 12:10:42 +0200 Subject: [PATCH 12/16] Update names --- .github/workflows/FMITest.yml | 4 ++-- .github/workflows/Test.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/FMITest.yml b/.github/workflows/FMITest.yml index 7ecfffa86..d344c38aa 100644 --- a/.github/workflows/FMITest.yml +++ b/.github/workflows/FMITest.yml @@ -6,14 +6,14 @@ on: - cron: "0 9 * * *" jobs: - test: + FMITest: runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: matrix: python-version: ['3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['stable', 'nightly'] + omc-version: ['nightly'] steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 53cd12ab0..e842b5430 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - test: + Test: runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: From 2536d667f3c6eade2d082da430f8a3d286135bed Mon Sep 17 00:00:00 2001 From: Adeel Asghar Date: Fri, 10 Oct 2025 12:14:28 +0200 Subject: [PATCH 13/16] Avoid running stable on Test.yml --- .github/workflows/FMITest.yml | 4 ++-- .github/workflows/Test.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/FMITest.yml b/.github/workflows/FMITest.yml index d344c38aa..7ecfffa86 100644 --- a/.github/workflows/FMITest.yml +++ b/.github/workflows/FMITest.yml @@ -6,14 +6,14 @@ on: - cron: "0 9 * * *" jobs: - FMITest: + test: runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: matrix: python-version: ['3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['nightly'] + omc-version: ['stable', 'nightly'] steps: - uses: actions/checkout@v5 diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index e842b5430..ed752ee41 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -7,14 +7,14 @@ on: workflow_dispatch: jobs: - Test: + test: runs-on: ${{ matrix.os }} timeout-minutes: 30 strategy: matrix: python-version: ['3.10', '3.12'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['stable', 'nightly'] + omc-version: ['nightly'] steps: - uses: actions/checkout@v5 From 20de14d32e6a1d70fec0fdf5e811c47c5f2ece6c Mon Sep 17 00:00:00 2001 From: Adeel Asghar Date: Fri, 10 Oct 2025 12:47:42 +0200 Subject: [PATCH 14/16] Test with python 3.13 Added Publish job to put the wheel on PyPI --- .github/workflows/Test.yml | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index ed752ee41..3fc4493d2 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -1,8 +1,10 @@ -name: Test +name: Test-Publish on: push: branches: ['master'] + tags: + - 'v*' # only publish when pushing version tags (e.g., v1.0.0) pull_request: workflow_dispatch: @@ -12,7 +14,7 @@ jobs: timeout-minutes: 30 strategy: matrix: - python-version: ['3.10', '3.12'] + python-version: ['3.10', '3.12', '3.13'] os: ['ubuntu-latest', 'windows-latest'] omc-version: ['nightly'] @@ -61,3 +63,35 @@ jobs: custom-arguments: '-v ' click-to-expand: true report-title: 'Test Report' + + Publish: + name: Publish to PyPI + runs-on: ${{ matrix.os }} + needs: test + strategy: + matrix: + python-version: ['3.10'] + os: ['ubuntu-latest'] + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v5 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip build setuptools wheel twine + + - name: Build wheel and sdist packages + run: python -m build --wheel --sdist --outdir dist + + - name: Publish wheel and sdist packages to PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_OMPYTHON_API_TOKEN }} + run: | + python -m twine upload dist/* --skip-existing From 3a9e26bd668937dcbb04fb3a75179943da2a1b12 Mon Sep 17 00:00:00 2001 From: Adeel Asghar Date: Mon, 20 Oct 2025 12:12:47 +0200 Subject: [PATCH 15/16] Build sdist and wheel Test wheel with twine --- .github/workflows/Test.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 3fc4493d2..163481a28 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -16,7 +16,7 @@ jobs: matrix: python-version: ['3.10', '3.12', '3.13'] os: ['ubuntu-latest', 'windows-latest'] - omc-version: ['nightly'] + omc-version: ['stable', 'nightly'] steps: - uses: actions/checkout@v5 @@ -29,7 +29,7 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip build setuptools wheel twine pip install . pytest pytest-md pytest-emoji pre-commit - name: Set timezone @@ -50,9 +50,11 @@ jobs: 'Modelica 4.0.0' - run: "omc --version" - - name: Pull OpenModelica docker image - if: runner.os != 'Windows' - run: docker pull openmodelica/openmodelica:v1.25.0-minimal + - name: Build wheel and sdist packages + run: python -m build --wheel --sdist --outdir dist + + - name: Check twine + run: python -m twine check dist/* - name: Run pytest uses: pavelzw/pytest-action@v2 From dfa9b6fef295c1c721a91e0d88992dbabd359004 Mon Sep 17 00:00:00 2001 From: Adeel Asghar Date: Mon, 20 Oct 2025 12:24:03 +0200 Subject: [PATCH 16/16] Docker image --- .github/workflows/Test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 163481a28..efd4d51d0 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -50,6 +50,10 @@ jobs: 'Modelica 4.0.0' - run: "omc --version" + - name: Pull OpenModelica docker image + if: runner.os != 'Windows' + run: docker pull openmodelica/openmodelica:v1.25.0-minimal + - name: Build wheel and sdist packages run: python -m build --wheel --sdist --outdir dist