Coverage for src/mkdocs_gallery/__init__.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-30 08:26 +0000

1# Authors: Sylvain MARIE <sylvain.marie@se.com> 

2# + All contributors to <https://github.com/smarie/mkdocs-gallery> 

3# 

4# Original idea and code: sphinx-gallery, <https://sphinx-gallery.github.io> 

5# License: 3-clause BSD, <https://github.com/smarie/mkdocs-gallery/blob/master/LICENSE> 

6import os 

7 

8try: 

9 # -- Distribution mode -- 

10 # import from _version.py generated by setuptools_scm during release 

11 from ._version import version as __version__ 

12except ImportError: 

13 # -- Source mode -- 

14 # use setuptools_scm to get the current version from src using git 

15 from os import path as _path 

16 

17 from setuptools_scm import get_version as _gv 

18 

19 __version__ = _gv(_path.join(_path.dirname(__file__), _path.pardir)) 

20 

21 

22base_path = os.path.dirname(os.path.abspath(__file__)) 

23 

24 

25def glr_path_static(): 

26 """Returns path to packaged static files""" 

27 return os.path.join(base_path, "static") 

28 

29 

30__all__ = [ 

31 "__version__", 

32 # submodules 

33 "plugin", 

34 # symbols 

35 "glr_path_static", 

36]