Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
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
15 changes: 15 additions & 0 deletions 15 pythonnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@
_LOADED: bool = False


try:
import importlib.metadata
__version__ = importlib.metadata.version("pythonnet")
except Exception:
try:
import pkg_resources # part of setuptools
__version__ = pkg_resources.require("pythonnet")[0].version
except Exception:
try:
with open(Path(__file__).parent.parent / "version.txt") as f:
__version__ = f.read().strip()
except Exception:
__version__ = "unknown"


def set_runtime(runtime: Union[clr_loader.Runtime, str], **params: str) -> None:
"""Set up a clr_loader runtime without loading it

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.