forked from YiHok/FPGABuilder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
142 lines (137 loc) · 4.59 KB
/
setup.py
File metadata and controls
142 lines (137 loc) · 4.59 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
import re
# 读取版本号
with open(os.path.join(os.path.dirname(__file__), 'src', 'core', '__init__.py'), 'r', encoding='utf-8') as f:
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", f.read(), re.M)
if version_match:
version = version_match.group(1)
else:
version = '0.1.0'
# 读取README
with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()
# 读取依赖
try:
with open('requirements.txt', 'r', encoding='utf-8') as f:
requirements = [line.strip() for line in f if line.strip() and not line.startswith('#')]
except FileNotFoundError:
# 如果requirements.txt不存在,使用硬编码的依赖列表
requirements = [
'click>=8.0.0',
'pyyaml>=6.0',
'colorama>=0.4.6',
'toml>=0.10.0',
'jsonschema>=4.0.0',
'pydantic>=2.0.0',
'tqdm>=4.65.0',
'rich>=13.0.0',
'prompt-toolkit>=3.0.0',
'questionary>=2.0.0',
'python-dotenv>=1.0.0',
'watchdog>=3.0.0',
'pywin32>=305; sys_platform == "win32"',
'gitpython>=3.1.0',
'requests>=2.31.0',
'aiohttp>=3.8.0',
]
print("警告: requirements.txt未找到,使用默认依赖列表")
setup(
name="FPGABuilder",
version=version,
author="YiHok",
author_email="yhn20112011@hotmail.com",
description="跨平台FPGA自动构建工具链",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/yhn20112011/FPGABuilder",
project_urls={
"Bug Tracker": "https://github.com/yhn20112011/FPGABuilder/issues",
"Documentation": "https://yhn20112011.github.io/FPGABuilder/",
"Source Code": "https://github.com/yhn20112011/FPGABuilder",
},
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Embedded Systems",
"Topic :: System :: Hardware",
"License :: Other/Proprietary License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
],
package_dir={"": "src"},
packages=find_packages(where="src"),
include_package_data=True,
package_data={
"": ["*.yaml", "*.yml", "*.tcl", "*.template", "*.md", "*.txt"],
"fpga_builder": ["config/*.yaml", "config/templates/*", "templates/*"],
},
python_requires=">=3.8",
install_requires=requirements,
entry_points={
"console_scripts": [
"FPGABuilder=core.cli:main",
"fpgab=core.cli:main", # 短别名
],
},
extras_require={
"dev": [
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"black>=23.0.0",
"flake8>=6.0.0",
"mypy>=1.0.0",
"sphinx>=7.0.0",
"sphinx-rtd-theme>=1.0.0",
"twine>=4.0.0",
],
"docs": [
"mkdocs>=1.5.0",
"mkdocs-material>=9.0.0",
"mkdocstrings>=0.23.0",
],
"packaging": [
"build>=1.0.0",
"pyinstaller>=5.0.0",
"setuptools>=65.0.0",
"wheel>=0.40.0",
],
"gui": [
"windows-curses>=2.3.0; sys_platform == 'win32'",
"curses>=2.2; sys_platform != 'win32'",
],
"vivado": [
# Vivado相关额外依赖
],
"quartus": [
# Quartus相关额外依赖
],
"full": [
"mkdocs>=1.5.0",
"mkdocs-material>=9.0.0",
"mkdocstrings>=0.23.0",
"pytest>=7.0.0",
"pytest-cov>=4.0.0",
"black>=23.0.0",
"flake8>=6.0.0",
"mypy>=1.0.0",
"build>=1.0.0",
"pyinstaller>=5.0.0",
"windows-curses>=2.3.0; sys_platform == 'win32'",
],
},
keywords="fpga, build, automation, xilinx, vivado, quartus, hardware",
license="Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International",
platforms=["Windows", "Linux", "Mac OS-X"],
)