forked from jaywhj/mkdocs-document-dates
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
73 lines (67 loc) · 2.22 KB
/
Copy pathsetup.py
File metadata and controls
73 lines (67 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
from setuptools import setup, find_packages
from setuptools.command.install import install
import atexit
def trigger_hook_install():
try:
import os
import sys
package_path = os.path.abspath(os.path.dirname(__file__))
if package_path not in sys.path:
sys.path.insert(0, package_path)
# from mkdocs_document_dates.hooks_installer import install
# install()
# import mkdocs_document_dates
__import__('mkdocs_document_dates')
except Exception as e:
print(f"Warning: Failed to install Git hooks: {e}")
class CustomInstallCommand(install):
def run(self):
atexit.register(trigger_hook_install)
install.run(self)
try:
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
except FileNotFoundError:
long_description = "A new generation MkDocs plugin for displaying exact creation time, last update time, authors, email of documents"
VERSION = '3.3.5'
setup(
name="mkdocs-document-dates",
version=VERSION,
author="Aaron Wang",
author_email="aaronwqt@gmail.com",
license="MIT",
description="A new generation MkDocs plugin for displaying exact creation time, last update time, authors, email of documents",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/jaywhj/mkdocs-document-dates",
packages=find_packages(),
install_requires=[
'mkdocs>=1.1.0',
],
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
],
cmdclass={
'install': CustomInstallCommand,
},
entry_points={
'mkdocs.plugins': [
'document-dates = mkdocs_document_dates.plugin:DocumentDatesPlugin',
],
'console_scripts': [
# 提供手动安装 hooks 的入口
'mkdocs-document-dates-hooks=mkdocs_document_dates.hooks_installer:install'
],
},
package_data={
'mkdocs_document_dates': [
'hooks/*',
'static/fonts/*',
'static/tippy/*',
'static/core/*',
'static/config/*'
],
},
python_requires=">=3.7",
)