File: rename_module.py

package info (click to toggle)
python-typing-inspection 0.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 384 kB
  • sloc: python: 1,120; makefile: 33; sh: 6
file content (13 lines) | stat: -rw-r--r-- 465 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
# Temporary hack to discard the actual py file and only use the stub file.
# See https://github.com/mkdocstrings/mkdocstrings/issues/737.
from pathlib import Path

path = Path(__file__).parents[2] / 'src' / 'typing_inspection'


def on_startup(*args: object, **kwargs: object) -> None:
    path.joinpath('typing_objects.py').rename(path / 'typing_objects._py')


def on_shutdown() -> None:
    path.joinpath('typing_objects._py').rename(path / 'typing_objects.py')