-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
52 lines (45 loc) · 1.48 KB
/
Copy pathsetup.py
File metadata and controls
52 lines (45 loc) · 1.48 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
# -- coding: utf-8 --
# @Time : 2024/6/6 11:10
# @Author : PinBar
# @File : setup.py
import os
import shutil
from setuptools import setup, find_packages
def clean_pyc_and_cache():
for root, dirs, files in os.walk('.'):
for file in files:
if file.endswith('.pyc'):
os.remove(os.path.join(root, file))
if '__pycache__' in dirs:
shutil.rmtree(os.path.join(root, '__pycache__'))
def parse_requirements(filename):
with open(filename, 'r', encoding='utf-8') as f:
lines = f.readlines()
# 忽略空行和注释
requirements = [line.strip() for line in lines if line.strip() and not line.startswith('#')]
return requirements
clean_pyc_and_cache()
setup(
name="fastapi_build",
version="1.0.4",
packages=find_packages(),
url="https://github.com/tosmart01/fastapi-build",
include_package_data=True,
exclude_package_data={'': ['*.pyc', '__pycache__/*', '*.db']},
install_requires=parse_requirements('requirements.txt'),
entry_points={
"console_scripts": [
"fbuild=fastapi_build.scripts.cli:cli",
],
},
package_data={
"": ["*.md", "*.txt", "docker_build.sh", "Dockerfile", ".gitignores", "alembic.ini", 'script.py.mako',
"scripts/example_file"
],
},
classifiers=[
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)