mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2025-08-16 03:40:26 +08:00
update setup.py
This commit is contained in:
13
setup.py
13
setup.py
@ -1,7 +1,16 @@
|
|||||||
import os
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
from setuptools import find_packages, setup
|
from setuptools import find_packages, setup
|
||||||
from fastapi_admin import __version__
|
|
||||||
|
|
||||||
|
def version():
|
||||||
|
ver_str_line = open('fastapi_admin/__init__.py', 'rt').read()
|
||||||
|
mob = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", ver_str_line, re.M)
|
||||||
|
if not mob:
|
||||||
|
raise RuntimeError("Unable to find version string")
|
||||||
|
return mob.group(1)
|
||||||
|
|
||||||
|
|
||||||
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
|
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
|
||||||
long_description = f.read()
|
long_description = f.read()
|
||||||
@ -13,7 +22,7 @@ def requirements():
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='fastapi-admin',
|
name='fastapi-admin',
|
||||||
version=__version__,
|
version=version(),
|
||||||
description='Fast Admin Dashboard based on fastapi and tortoise-orm and rest-admin.',
|
description='Fast Admin Dashboard based on fastapi and tortoise-orm and rest-admin.',
|
||||||
author='long2ice',
|
author='long2ice',
|
||||||
long_description_content_type='text/x-rst',
|
long_description_content_type='text/x-rst',
|
||||||
|
Reference in New Issue
Block a user