Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pyvista-mypy-plugin

Mypy plugin for the PyVista project.

This plugin is primarily used for type-promotion between related classes that do not inherit from each other. For example, the abstract class pyvista.DataSet does not inherit from vtk.vtkDataSet, and will generate type errors wherever a vtk.vtkDataSet is expected. Without this plugin, the following is a type error:

from pyvista import DataSet
from vtkmodules.vtkCommonDataModel import vtkDataSet

x: vtkDataSet
x = DataSet()  # error: Incompatible types in assignment (expression has type "DataSet", variable has type "vtkDataSet")'

(Note that the example above is not valid at runtime since DataSet is an abstract class and cannot be instantiated.)

With this plugin, DataSet is promoted as type vtkDataSet, allowing DataSet type to be used wherever vtkDataSet is used.

Installation

Dependencies:

Install it with:

python -m pip install pyvista-mypy-plugin

Alternatively, add pyvista-mypy-plugin as a project dependency wherever mypy is used, e.g. as an optional dev requirement in pyproject.toml:

[project.optional-dependencies]
dev = ["mypy", "pyvista-mypy-plugin"]

Usage

To enable the plugin, it must be added to your project's mypy configuration file. E.g. add the following to pyproject.toml:

[tool.mypy]
plugins = [
  'pyvista_mypy_plugin',
]

Testing

First, install pyvista-mypy-plugin with dev requirements:

python -m pip install pyvista-mypy-plugin[dev]

To run the tests, execute:

pytest

Metadata

Release files for ducktype-mypy-plugin 0.2.dev1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ducktype-mypy-plugin 0.2.dev1
File Interpreter ABI Platform
ducktype_mypy_plugin-0.2.dev1-py3-none-any.whl Python 3 none any Details

Release files / ducktype_mypy_plugin-0.2.dev1-py3-none-any.whl

Download URL ducktype_mypy_plugin-0.2.dev1-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0326374829ea3f34033d90ef11cc550e3d3281f273f74cf1465689fe26b98a79
BLAKE2b-256 checksum
How to use checksums
9d3bdf557d60945ae72e54594ea6533f9ddecc4e3d029f6af589fe30a0ef061f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.2

Security for ducktype-mypy-plugin 0.2.dev1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page