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
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ dependencies = [
"pathsim",
"numpy>=1.15",
"scipy>=1.2",
"jsbsim>=1.2.4"
# JSBSim ships native code that can't be installed in Pyodide. The
# marker resolves to a normal eager install on every real platform and
# is skipped on Emscripten so the pure-Python parts of the toolbox
# (`pathsim_flight.atmosphere`, `.utils`) still install in the browser.
"jsbsim>=1.2.4; sys_platform != 'emscripten'",
]

[project.optional-dependencies]
Expand Down
15 changes: 11 additions & 4 deletions src/pathsim_flight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@

__all__ = ["__version__"]

# For direct block import from main package
from .atmosphere import *
from .jsbsim import *
from .utils import *
# Pure-Python submodules — eager.
from .atmosphere import * # noqa: F401,F403
from .utils import * # noqa: F401,F403

# `jsbsim` wraps the native JSBSim Python bindings, which can't load in
# Pyodide. Re-export the wrapper only when the import succeeds; on a normal
# pip install it loads eagerly.
try:
from .jsbsim import * # noqa: F401,F403
except ImportError:
pass