This repository was archived by the owner on Aug 7, 2025. It is now read-only.
forked from Hsury/BiliDrive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
83 lines (73 loc) · 2.64 KB
/
Copy pathsetup.py
File metadata and controls
83 lines (73 loc) · 2.64 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
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
import setuptools
import os
import re
# Read version from __init__.py without importing the module
def get_version():
init_file = os.path.join(os.path.dirname(__file__), "BiliOpen", "__init__.py")
with open(init_file, "r", encoding="utf-8") as f:
content = f.read()
version_match = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', content, re.MULTILINE)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
# Read author and email from __init__.py without importing the module
def get_author_info():
init_file = os.path.join(os.path.dirname(__file__), "BiliOpen", "__init__.py")
with open(init_file, "r", encoding="utf-8") as f:
content = f.read()
author_match = re.search(r'^__author__\s*=\s*[\'"]([^\'"]*)[\'"]', content, re.MULTILINE)
email_match = re.search(r'^__email__\s*=\s*[\'"]([^\'"]*)[\'"]', content, re.MULTILINE)
author = author_match.group(1) if author_match else "Unknown"
email = email_match.group(1) if email_match else "[email protected]"
return author, email
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("requirements.txt", "r", encoding="utf-8") as fh:
install_requires = fh.read().splitlines()
author, email = get_author_info()
setuptools.setup(
name="BiliOpen",
version=get_version(),
url="https://github.com/Wodlie/BiliOpen",
author=author,
author_email=email,
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Natural Language :: Chinese (Simplified)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Topic :: Communications :: File Sharing",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Utilities",
],
description="☁️ 哔哩开放云,支持任意文件的全速上传与下载",
long_description=long_description,
long_description_content_type="text/markdown",
keywords=[
"bilibili",
"cloud",
"disk",
"drive",
"storage",
"pan",
"yun",
"B站",
"哔哩哔哩",
"网盘"
],
install_requires=install_requires,
python_requires=">=3.6",
entry_points={
'console_scripts': [
"BiliOpen=BiliOpen.__main__:main",
],
},
packages=setuptools.find_packages(),
)