Skip to content

Commit bd54ec7

Browse files
authored
feat: minor improvements (#128)
1 parent c5222a0 commit bd54ec7

File tree

5 files changed

+41
-23
lines changed

5 files changed

+41
-23
lines changed

doc/source/getting_started/installation.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@
44
Install packages
55
================
66

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

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

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

15-
.. .. code::
15+
.. code::
1616
17-
.. pip install ansys-sherlock-core
17+
pip install ansys-sherlock-core
18+
19+
If you want to install the ``ansys-api-sherlock`` and ``ansys-sherlock-core`` packages
20+
from its source code directly, follow the upcoming instructions:
1821

1922
#. Download the latest ``ansys-api-sherlock`` package by running this
2023
``git clone`` command:
@@ -35,7 +38,7 @@ and ``ansys-sherlock`` packages.
3538
cd ansys-api-sherlock
3639
pip install -e .
3740
38-
#. Download the latest ``ansys-sherlock`` package by running this
41+
#. Download the latest ``ansys-sherlock-core`` package by running this
3942
``git clone`` command:
4043

4144
.. code::

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
44

55
[project]
66
name = "ansys-sherlock-core"
7-
version = "0.1.dev0"
7+
version = "0.2.dev0"
88
description = "A python wrapper for Ansys Sherlock"
99
readme = "README.rst"
1010
requires-python = ">=3.8,<4"
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
# © 2023 ANSYS, Inc. All rights reserved.
22

33
"""PySherlock client library."""
4-
from ansys.sherlock.core._version import __version__
4+
5+
# Version
6+
# ------------------------------------------------------------------------------
7+
8+
try:
9+
import importlib.metadata as importlib_metadata
10+
except ModuleNotFoundError: # pragma: no cover
11+
import importlib_metadata # type: ignore
12+
13+
__version__ = importlib_metadata.version(__name__.replace(".", "-"))
14+
"""PySherlock version."""
15+
16+
# Ease import statements
17+
# ------------------------------------------------------------------------------
18+
519
from ansys.sherlock.core.logging import Logger
620

721
LOG = Logger("sherlock")
8-
SHERLOCK = None
22+
"""PySherlock logger."""

src/ansys/sherlock/core/_version.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/test_metadata.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from ansys.sherlock.core import __version__
2+
3+
4+
def test_pkg_version():
5+
try:
6+
import importlib.metadata as importlib_metadata
7+
except ModuleNotFoundError: # pragma: no cover
8+
import importlib_metadata
9+
10+
# Read from the pyproject.toml
11+
# major, minor, patch
12+
read_version = importlib_metadata.version("ansys-sherlock-core")
13+
14+
assert __version__ == read_version

0 commit comments

Comments
 (0)