2020-06-30 17:50:35 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
|
|
|
|
from setuptools import setup, find_packages
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
"""
|
|
|
|
with open("README.md", encoding="utf8") as f:
|
|
|
|
return f.read()
|
|
|
|
|
|
|
|
|
|
|
|
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,
|
|
|
|
python_requires=">=3.7",
|
|
|
|
version=get_version(module_name),
|
|
|
|
url="https://gite.lirmm.fr/newsi/api/halfapi",
|
|
|
|
long_description=get_long_description(),
|
|
|
|
long_description_content_type="text/markdown",
|
|
|
|
packages=get_packages(module_name),
|
|
|
|
package_data={
|
2020-07-02 11:37:28 +02:00
|
|
|
'halfapi': ['lib/*', 'models/*']
|
2020-06-30 17:50:35 +02:00
|
|
|
},
|
|
|
|
install_requires=[
|
|
|
|
"click",
|
2020-07-02 16:32:55 +02:00
|
|
|
"jwt",
|
2020-06-30 17:50:35 +02:00
|
|
|
"starlette",
|
|
|
|
"uvicorn"],
|
|
|
|
extras_require={
|
2020-07-03 11:58:13 +02:00
|
|
|
"tests":["pytest", "requests"],
|
|
|
|
"domains":["organigramme"]
|
2020-06-30 17:50:35 +02:00
|
|
|
},
|
|
|
|
entry_points={
|
|
|
|
"console_scripts":[
|
|
|
|
"halfapi=halfapi.cli:cli"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
)
|