Skip to content

Commit c902a4b

Browse files
arun3688adeas31
andauthored
update release version to 4.0.0 (#355)
* update release version to 4.0.0 * test only on windows * fix jenkins file * add LICENSE file for pip package * disable nightly tests * Fix LICENSE end-of-file formatting * disable docker test * check only nightly builds * enable docker test * enable omc stable version * Update setup-openmodelica * Update names * Avoid running stable on Test.yml * Test with python 3.13 Added Publish job to put the wheel on PyPI * Build sdist and wheel Test wheel with twine * Docker image --------- Co-authored-by: Adeel Asghar <[email protected]>
1 parent ad91868 commit c902a4b

File tree

4 files changed

+74
-8
lines changed

4 files changed

+74
-8
lines changed

.github/workflows/FMITest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v5
2020
- name: "Set up OpenModelica Compiler"
21-
uses: OpenModelica/[email protected]
21+
uses: OpenModelica/[email protected].2
2222
with:
2323
version: ${{ matrix.omc-version }}
2424
packages: |

.github/workflows/Test.yml

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
name: Test
1+
name: Test-Publish
22

33
on:
44
push:
55
branches: ['master']
6+
tags:
7+
- 'v*' # only publish when pushing version tags (e.g., v1.0.0)
68
pull_request:
79
workflow_dispatch:
810

@@ -12,9 +14,9 @@ jobs:
1214
timeout-minutes: 30
1315
strategy:
1416
matrix:
15-
python-version: ['3.10', '3.12']
17+
python-version: ['3.10', '3.12', '3.13']
1618
os: ['ubuntu-latest', 'windows-latest']
17-
omc-version: ['stable']
19+
omc-version: ['stable', 'nightly']
1820

1921
steps:
2022
- uses: actions/checkout@v5
@@ -27,7 +29,7 @@ jobs:
2729

2830
- name: Install dependencies
2931
run: |
30-
python -m pip install --upgrade pip
32+
python -m pip install --upgrade pip build setuptools wheel twine
3133
pip install . pytest pytest-md pytest-emoji pre-commit
3234
3335
- name: Set timezone
@@ -39,7 +41,7 @@ jobs:
3941
run: 'pre-commit run --all-files'
4042

4143
- name: "Set up OpenModelica Compiler"
42-
uses: OpenModelica/[email protected]
44+
uses: OpenModelica/[email protected].2
4345
with:
4446
version: ${{ matrix.omc-version }}
4547
packages: |
@@ -52,6 +54,12 @@ jobs:
5254
if: runner.os != 'Windows'
5355
run: docker pull openmodelica/openmodelica:v1.25.0-minimal
5456

57+
- name: Build wheel and sdist packages
58+
run: python -m build --wheel --sdist --outdir dist
59+
60+
- name: Check twine
61+
run: python -m twine check dist/*
62+
5563
- name: Run pytest
5664
uses: pavelzw/pytest-action@v2
5765
with:
@@ -61,3 +69,35 @@ jobs:
6169
custom-arguments: '-v '
6270
click-to-expand: true
6371
report-title: 'Test Report'
72+
73+
Publish:
74+
name: Publish to PyPI
75+
runs-on: ${{ matrix.os }}
76+
needs: test
77+
strategy:
78+
matrix:
79+
python-version: ['3.10']
80+
os: ['ubuntu-latest']
81+
if: startsWith(github.ref, 'refs/tags/')
82+
steps:
83+
- uses: actions/checkout@v5
84+
85+
- name: Set up Python ${{ matrix.python-version }}
86+
uses: actions/setup-python@v5
87+
with:
88+
python-version: ${{ matrix.python-version }}
89+
architecture: 'x64'
90+
91+
- name: Install dependencies
92+
run: |
93+
python -m pip install --upgrade pip build setuptools wheel twine
94+
95+
- name: Build wheel and sdist packages
96+
run: python -m build --wheel --sdist --outdir dist
97+
98+
- name: Publish wheel and sdist packages to PyPI
99+
env:
100+
TWINE_USERNAME: __token__
101+
TWINE_PASSWORD: ${{ secrets.PYPI_OMPYTHON_API_TOKEN }}
102+
run: |
103+
python -m twine upload dist/* --skip-existing

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
This project is part of OpenModelica.
2+
3+
Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC),
4+
c/o Linköpings universitet, Department of Computer and Information Science,
5+
SE-58183 Linköping, Sweden.
6+
7+
All rights reserved.
8+
9+
THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE
10+
GPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
11+
ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
12+
RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
13+
ACCORDING TO RECIPIENTS CHOICE.
14+
15+
The OpenModelica software and the OSMC (Open Source Modelica Consortium)
16+
Public License (OSMC-PL) are obtained from OSMC, either from the above
17+
address, from the URLs: http://www.openmodelica.org or
18+
http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica
19+
distribution. GNU version 3 is obtained from:
20+
http://www.gnu.org/copyleft/gpl.html. The New BSD License is obtained from:
21+
http://www.opensource.org/licenses/BSD-3-Clause.
22+
23+
This program is distributed WITHOUT ANY WARRANTY; without even the implied
24+
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS
25+
EXPRESSLY SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE
26+
CONDITIONS OF OSMC-PL.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "OMPython"
7-
version = "3.6.0"
7+
version = "4.0.0"
88
description = "OpenModelica-Python API Interface"
99
readme = "README.md"
1010
authors = [
@@ -13,7 +13,7 @@ authors = [
1313
maintainers = [
1414
{name = "Adeel Asghar", email = "[email protected]"},
1515
]
16-
license = "BSD-3-Clause OR LicenseRef-OSMC-PL-1.2 OR GPL-3.0-only"
16+
license = { file = "LICENSE" }
1717
requires-python = ">=3.10"
1818
dependencies = [
1919
"numpy",

0 commit comments

Comments
 (0)