2020-07-23 17:54:47 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
|
|
|
|
from setuptools import setup, find_packages
|
|
|
|
|
2020-07-29 21:08:02 +02:00
|
|
|
import pathlib
|
2020-07-23 17:54:47 +02:00
|
|
|
|
|
|
|
def get_version(package):
|
|
|
|
"""
|
|
|
|
Return package version as listed in `__version__` in `init.py`.
|
|
|
|
"""
|
|
|
|
with open(os.path.join(package, "__init__.py")) as f:
|
|
|
|
return re.search("__version__ = ['\"]([^'\"]+)['\"]", f.read()).group(1)
|
|
|
|
|
|
|
|
|
|
|
|
def get_long_description():
|
|
|
|
"""
|
|
|
|
Return the README.
|
|
|
|
"""
|
2020-07-29 21:08:02 +02:00
|
|
|
here = pathlib.Path(__file__).parent.resolve()
|
|
|
|
long_description = (here / 'README.md').read_text(encoding='utf-8')
|
2020-07-23 17:54:47 +02:00
|
|
|
|
|
|
|
def get_packages(package):
|
|
|
|
"""
|
|
|
|
Return root package and all sub-packages.
|
|
|
|
"""
|
|
|
|
return [
|
|
|
|
dirpath
|
|
|
|
for dirpath, dirnames, filenames in os.walk(package)
|
|
|
|
if os.path.exists(os.path.join(dirpath, "__init__.py"))
|
|
|
|
]
|
|
|
|
|
|
|
|
module_name="halfapi"
|
|
|
|
setup(
|
|
|
|
name=module_name,
|
|
|
|
version=get_version(module_name),
|
2020-07-29 21:08:02 +02:00
|
|
|
url="https://gite.lirmm.fr/malves/halfapi",
|
2020-07-23 17:54:47 +02:00
|
|
|
long_description=get_long_description(),
|
|
|
|
long_description_content_type="text/markdown",
|
|
|
|
packages=get_packages(module_name),
|
2020-07-29 21:08:02 +02:00
|
|
|
python_requires=">=3.7",
|
2020-07-23 17:54:47 +02:00
|
|
|
install_requires=[
|
2020-08-07 02:08:22 +02:00
|
|
|
"PyJWT>=1.7.1",
|
2020-08-05 09:32:00 +02:00
|
|
|
"starlette>=0.13,<1",
|
2020-07-30 10:03:04 +02:00
|
|
|
"half_orm @ git+ssh://git@gite.lirmm.fr/maizi/halfORM.git",
|
2020-08-05 09:32:00 +02:00
|
|
|
"click>=7.1,<8",
|
|
|
|
"uvicorn>=0.11,<1"
|
2020-07-29 21:08:02 +02:00
|
|
|
],
|
2020-07-23 17:54:47 +02:00
|
|
|
extras_require={
|
2020-07-29 21:08:02 +02:00
|
|
|
"tests":[
|
|
|
|
"pytest",
|
|
|
|
"requests"
|
|
|
|
]
|
2020-07-23 17:54:47 +02:00
|
|
|
},
|
|
|
|
entry_points={
|
|
|
|
"console_scripts":[
|
2020-08-05 13:59:46 +02:00
|
|
|
"halfapi=halfapi.cli.cli:cli"
|
2020-07-23 17:54:47 +02:00
|
|
|
]
|
|
|
|
}
|
|
|
|
)
|