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
17 changes: 10 additions & 7 deletions doc/source/getting_started/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@
Install packages
================

The ``ansys-sherlock`` package supports Python 3.7 through Python 3.10 on Windows.
The ``ansys-sherlock-core`` package supports Python 3.7 through Python 3.10 on Windows.

To use PySherlock, you must download and install both the ``ansys-api-sherlock``
and ``ansys-sherlock`` packages.
and ``ansys-sherlock-core`` packages. By using ``pip``, ``ansys-api-sherlock`` is
installed as part of ``ansys-sherlock-core``. Run the following to install

.. TODO: uncomment the following lines when PySherlock is released to the public PyPi.
Install the latest ``ansys-sherlock-core`` package from PyPi with:
the publicly distributed version of the package.

.. .. code::
.. code::

.. pip install ansys-sherlock-core
pip install ansys-sherlock-core

If you want to install the ``ansys-api-sherlock`` and ``ansys-sherlock-core`` packages
from its source code directly, follow the upcoming instructions:

#. Download the latest ``ansys-api-sherlock`` package by running this
``git clone`` command:
Expand All @@ -35,7 +38,7 @@ and ``ansys-sherlock`` packages.
cd ansys-api-sherlock
pip install -e .

#. Download the latest ``ansys-sherlock`` package by running this
#. Download the latest ``ansys-sherlock-core`` package by running this
``git clone`` command:

.. code::
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"

[project]
name = "ansys-sherlock-core"
version = "0.1.dev0"
version = "0.2.dev0"
description = "A python wrapper for Ansys Sherlock"
readme = "README.rst"
requires-python = ">=3.8,<4"
Expand Down
18 changes: 16 additions & 2 deletions src/ansys/sherlock/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
# © 2023 ANSYS, Inc. All rights reserved.

"""PySherlock client library."""
from ansys.sherlock.core._version import __version__

# Version
# ------------------------------------------------------------------------------

try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError: # pragma: no cover
import importlib_metadata # type: ignore

__version__ = importlib_metadata.version(__name__.replace(".", "-"))
"""PySherlock version."""

# Ease import statements
# ------------------------------------------------------------------------------

from ansys.sherlock.core.logging import Logger

LOG = Logger("sherlock")
SHERLOCK = None
"""PySherlock logger."""
13 changes: 0 additions & 13 deletions src/ansys/sherlock/core/_version.py

This file was deleted.

14 changes: 14 additions & 0 deletions tests/test_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from ansys.sherlock.core import __version__


def test_pkg_version():
try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError: # pragma: no cover
import importlib_metadata

# Read from the pyproject.toml
# major, minor, patch
read_version = importlib_metadata.version("ansys-sherlock-core")

assert __version__ == read_version