Installation¶
Stable release¶
Add gmshparser to a uv-managed project:
Install it into the active Python environment with pip:
The package requires Python 3.12 or newer.
Typing support¶
gmshparser ships inline PEP 561 type information and a py.typed marker. Type
checkers such as mypy and pyright therefore use the annotations from the installed
package without a separate stubs distribution.
Development version¶
Install the current master branch directly from GitHub:
or with pip:
Verify the installation¶
In a uv-managed project, prefix commands with uv run when needed:
NumPy dependency¶
The core package does not depend on NumPy. Install the optional extra for array interoperability:
or with pip:
The optional API is then available as gmshparser.numpy.
Visualization dependency¶
The core package does not depend on matplotlib. Add it only for visualization:
For a repository checkout, use the predefined dependency group:
Development environment¶
Clone the repository and let uv create the local environment:
The default dev group includes the test, lint, and typing groups.
Install other groups explicitly:
Run project commands through uv:
uv run pytest
uv run ruff format --check gmshparser tests examples benchmarks
uv run ruff check gmshparser tests examples benchmarks
uv run mypy gmshparser
uv run mypy --strict tests/typing/public_api.py
Dependency lock files are intentionally not committed. A locally generated
uv.lock is ignored by Git.
Upgrade¶
In a uv project:
With pip:
Uninstall¶
Remove the dependency from a uv project:
With pip: