Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions .github/workflows/linter.yml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Linters

on:
push:
branches:
- master
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**.py"
- "**.ipynb"
- ".github/**"
- "pyproject.toml"
- "requirements*"
- ".pylintrc"
- "Makefile"

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pylint pytest
pip install -r requirements.in
- name: Ruff (lint)
run: ruff check --output-format=github .
- name: Ruff (format)
run: ruff format --check .
- name: Pylint
run: |
pylint examples/ rocketserializer/ tests/
4 changes: 4 additions & 0 deletions .github/workflows/test-pytest.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: pytest

on:
push:
branches:
- master
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
Expand Down
8 changes: 5 additions & 3 deletions rocketserializer/openrocket_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ def __init__(self, jar_path, log_level="OFF"):
)

# Get the default JVM path early so we can pass it
jvm_path = jpype.getDefaultJVMPath()
# Initialize the base class with kwargs to bypass auto-discovery
super().__init__(jar=str(self.jar_path), jvm=str(jvm_path), loglevel=log_level)
super().__init__(jar_path=str(self.jar_path), log_level=log_level)
self.jar_path = Path(self.jar_path) # orhelper may overwrite it as str
self.openrocket = None
# for newest orhelper support
self.openrocket_core = None
Expand All @@ -182,7 +182,9 @@ def _block_loader(gui_module, field_name):
pass

def __enter__(self):
ensure_java_compatibility(self.jar_path)
# We need to guarantee that the right Java is used for the jar
# before starting JVM
ensure_java_compatibility(Path(self.jar_path))

jvm_path = jpype.getDefaultJVMPath()
logger.info(
Expand Down
Loading