Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
*~
auto
*.swp
*.venv
4 changes: 3 additions & 1 deletion stextools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import importlib.metadata
from stextools.pythonapi import setup_logging, interactive_symbol_search

__version__ = importlib.metadata.version('stextools')
__all__ = [
'setup_logging',
'interactive_symbol_search',
'__version__'
]
11 changes: 3 additions & 8 deletions stextools/core/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@ class Cache:
@classmethod
@functools.cache
def get_stextools_version(cls) -> str:
"""For now, we will use the last modification time of the stextools package.

We could also use the git hash, but that would require that the package is installed from git.
In the future, a version number should be used."""
last_modified = -math.inf
for file in Path(__file__).parent.rglob('**/*.py'):
last_modified = max(last_modified, file.stat().st_mtime)
return str(last_modified)
"""Returns the version number of the presently installed stextools"""
from stextools import __version__
return __version__

@classmethod
def get_mathhub(cls, update_all: bool = False) -> MathHub:
Expand Down