-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove distutils, update CI - Replace distutils with setuptools and shutil - Update README.md - Update CI to test Python 3.10 and 3.12 - Adding dependabot for GitHub actions * Update more CI, fix version number * Add Windows to CI
- Loading branch information
1 parent
bb51f16
commit 1657078
Showing
7 changed files
with
60 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Set update schedule for GitHub Actions | ||
|
||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
# Check for updates to GitHub Actions every week | ||
interval: "monthly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,13 @@ jobs: | |
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
os: ['ubuntu-latest'] | ||
python-version: ['3.10', '3.12'] | ||
os: ['ubuntu-latest', 'windows-latest'] | ||
omc-version: ['stable'] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: "Set up OpenModelica Compiler" | ||
uses: OpenModelica/[email protected] | ||
with: | ||
|
@@ -26,12 +27,10 @@ jobs: | |
omc | ||
libraries: | | ||
'Modelica 4.0.0' | ||
- run: "omc --version" | ||
|
||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: 'x64' | ||
|
@@ -42,7 +41,7 @@ jobs: | |
pip install future pyparsing numpy psutil pyzmq pytest pytest-md pytest-emoji | ||
- name: Set timezone | ||
uses: szenius/set-timezone@v1.2 | ||
uses: szenius/set-timezone@v2.0 | ||
with: | ||
timezoneLinux: 'Europe/Berlin' | ||
|
||
|
@@ -54,4 +53,4 @@ jobs: | |
job-summary: true | ||
custom-arguments: '-v ' | ||
click-to-expand: true | ||
report-title: 'Test Report' | ||
report-title: 'Test Report' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ | |
.vs/ | ||
.DS_Store | ||
.vscode/ | ||
/.venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,45 +31,57 @@ Installation using `pip` is recommended. | |
|
||
Install the latest OMPython master by running: | ||
|
||
python -m pip install -U https://github.com/OpenModelica/OMPython/archive/master.zip | ||
```bash | ||
python -m pip install -U https://github.com/OpenModelica/OMPython/archive/master.zip | ||
``` | ||
|
||
### Windows | ||
|
||
Install the version as packaged with your OpenModelica installation by | ||
running: | ||
Install the version packed with your OpenModelica installation by running: | ||
|
||
```cmd | ||
cd %OPENMODELICAHOME%\share\omc\scripts\PythonInterface | ||
python -m pip install -U . | ||
``` | ||
|
||
cd %OPENMODELICAHOME%\share\omc\scripts\PythonInterface | ||
python -m pip install -U . | ||
### Local installation | ||
|
||
Instead, to Install the latest version of the OMPython master branch | ||
To Install the latest version of the OMPython master branch | ||
only, previously cloned into `<OMPythonPath>`, run: | ||
|
||
cd <OMPythonPath> | ||
python -m pip install -U . | ||
``` | ||
cd <OMPythonPath> | ||
python -m pip install -U . | ||
``` | ||
|
||
## Usage | ||
|
||
Running the following commads should get you started | ||
Running the following commands should get you started | ||
|
||
``` python | ||
```python | ||
import OMPython | ||
help(OMPython) | ||
``` | ||
|
||
or read the [OMPython | ||
documentation](https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/ompython.html) | ||
```python | ||
from OMPython import OMCSessionZMQ | ||
omc = OMCSessionZMQ() | ||
omc.sendExpression("getVersion()") | ||
``` | ||
|
||
or read the [OMPython documentation](https://openmodelica.org/doc/OpenModelicaUsersGuide/latest/ompython.html) | ||
online. | ||
|
||
## Bug Reports | ||
|
||
- See OMPython bugs on the [OpenModelica | ||
- See OMPython bugs on the [OpenModelica | ||
trac](https://trac.openmodelica.org/OpenModelica/query?component=OMPython) | ||
or submit a [new | ||
ticket](https://trac.openmodelica.org/OpenModelica/newticket). | ||
- [Pull requests](https://github.com/OpenModelica/OMPython/pulls) are | ||
- [Pull requests](https://github.com/OpenModelica/OMPython/pulls) are | ||
welcome. | ||
|
||
## Contact | ||
|
||
- Adeel Asghar, <[email protected]> | ||
- Arunkumar Palanisamy, <[email protected]> | ||
- Adeel Asghar, <[email protected]> | ||
- Arunkumar Palanisamy, <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
try: | ||
from setuptools import setup | ||
except ImportError: | ||
from distutils.core import setup | ||
|
||
from setuptools import setup | ||
from subprocess import call | ||
import os | ||
# Python 3.3 offers shutil.which() | ||
from distutils import spawn | ||
|
||
import shutil | ||
|
||
def warningOrError(errorOnFailure, msg): | ||
if errorOnFailure: | ||
raise Exception(msg) | ||
else: | ||
print(msg) | ||
|
||
|
||
def generateIDL(): | ||
errorOnFailure = not os.path.exists(os.path.join(os.path.dirname(__file__), 'OMPythonIDL', '__init__.py')) | ||
try: | ||
omhome = os.path.split(os.path.split(os.path.realpath(spawn.find_executable("omc")))[0])[0] | ||
path_to_omc = shutil.which("omc") | ||
omhome = os.path.dirname(os.path.dirname(os.path.split(path_to_omc))) | ||
except BaseException: | ||
omhome = None | ||
omhome = omhome or os.environ.get('OPENMODELICAHOME') | ||
|
@@ -54,8 +48,9 @@ def generateIDL(): | |
OMPython_packages.extend(['OMPythonIDL', 'OMPythonIDL._OMCIDL', 'OMPythonIDL._OMCIDL__POA']) | ||
|
||
setup(name='OMPython', | ||
version='3.5.2', | ||
version='3.6.0', | ||
description='OpenModelica-Python API Interface', | ||
long_description=open('README.md').read(), | ||
author='Anand Kalaiarasi Ganeson', | ||
author_email='[email protected]', | ||
maintainer='Adeel Asghar', | ||
|
@@ -64,11 +59,11 @@ def generateIDL(): | |
url='http://openmodelica.org/', | ||
packages=OMPython_packages, | ||
install_requires=[ | ||
# 'omniORB', # Required, but not part of pypi | ||
'future', | ||
'pyparsing', | ||
'numpy', | ||
'psutil', | ||
'pyparsing', | ||
'pyzmq' | ||
] | ||
], | ||
python_requires='>=3.8', | ||
) |