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 src/ansys/dpf/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import os
import pkg_resources

from ansys.dpf.core._version import __version__
try:
import importlib.metadata as importlib_metadata
except ImportError: # Python < 3.10 (backport)
import importlib_metadata as importlib_metadata

__version__ = importlib_metadata.version("ansys-dpf-core")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does it get the version from exactly? @PProfizi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BClappe from the pyproject.toml, meaning we have only one source of truth, and it is in the package metadata file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is part of the work to adhere to PyAnsys best practices.


# Setup data directory
USER_DATA_PATH = None
Expand Down
8 changes: 0 additions & 8 deletions src/ansys/dpf/core/_version.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
"""Version for ansys-dpf-core"""
# major, minor, patch

version_info = 0, 12, 3, "dev0"


# Nice string for the version
__version__ = ".".join(map(str, version_info))

# Minimal DPF server version supported
min_server_version = "4.0"

Expand Down
4 changes: 2 additions & 2 deletions src/ansys/dpf/core/server_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

import ansys.dpf.core as core
from ansys.dpf.core.check_version import server_meet_version
from ansys.dpf.core import errors, server_factory
from ansys.dpf.core._version import min_server_version, server_to_ansys_version, __version__
from ansys.dpf.core import errors, server_factory, __version__
from ansys.dpf.core._version import min_server_version, server_to_ansys_version
from ansys.dpf.core import server_context
from ansys.dpf.gate import load_api, data_processing_grpcapi

Expand Down