-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from pastas/some_fixes
Some minor fixes
- Loading branch information
Showing
3 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,38 @@ | ||
# ruff: noqa: D100 | ||
from importlib import import_module, metadata | ||
from platform import python_version | ||
|
||
import pastas as ps | ||
from packaging.version import parse as parse_version | ||
|
||
PASTAS_VERSION = parse_version(ps.__version__) | ||
PASTAS_LEQ_022 = PASTAS_VERSION <= parse_version("0.22.0") | ||
PASTAS_GEQ_150 = PASTAS_VERSION >= parse_version("1.5.0") | ||
|
||
__version__ = "1.5.0" | ||
|
||
|
||
def show_versions(optional=False) -> None: | ||
"""Print the version of dependencies. | ||
Parameters | ||
---------- | ||
optional : bool, optional | ||
Print the version of optional dependencies, by default False | ||
""" | ||
msg = ( | ||
f"Python version : {python_version()}\n" | ||
f"Pandas version : {metadata.version('pandas')}\n" | ||
f"Matplotlib version : {metadata.version('matplotlib')}\n" | ||
f"Pastas version : {metadata.version('pastas')}\n" | ||
f"PyYAML version : {metadata.version('pyyaml')}\n" | ||
) | ||
if optional: | ||
msg += "\nArcticDB version : " | ||
try: | ||
import_module("arcticdb") | ||
msg += f"{metadata.version('arctidb')}" | ||
except ImportError: | ||
msg += "Not Installed" | ||
|
||
__version__ = "1.4.0" | ||
print(msg) |