From 7ef6e7801090f401411c6adcf3bfa193bde7e6a6 Mon Sep 17 00:00:00 2001 From: "Maxime Alves LIRMM@home" Date: Wed, 29 Jul 2020 21:08:02 +0200 Subject: [PATCH] [deps] Updated dependencies and added files for standard packaging. The halfapi-cli tool needs to be installed using [cli] option : pip3 install -e .[cli] --- MANIFEST.in | 10 ++++++++++ pyproject.toml | 5 +++++ requirements.txt | 1 + setup.cfg | 2 ++ setup.py | 26 +++++++++++++++----------- 5 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 MANIFEST.in create mode 100644 pyproject.toml create mode 100644 setup.cfg diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..ca3d448 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,10 @@ +include pyproject.toml + +# Include the README +include *.md + +# Include the license file +include LICENSE.txt + +# Include the data files +recursive-include data * diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..6ddb34b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,5 @@ +[build-system] +# These are the assumed default build requirements from pip: +# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support +requires = ["setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt index f44aa78..76188bc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ starlette uvicorn jwt half_orm @ git+ssh://git@gite.lirmm.fr/newsi/halfORM.git +pygit2==0.28.2 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..8183238 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[metadata] +license_files = LICENSE diff --git a/setup.py b/setup.py index 0a4fbea..89e267c 100755 --- a/setup.py +++ b/setup.py @@ -6,6 +6,7 @@ import re from setuptools import setup, find_packages +import pathlib def get_version(package): """ @@ -19,9 +20,8 @@ def get_long_description(): """ Return the README. """ - with open("README.md", encoding="utf8") as f: - return f.read() - + here = pathlib.Path(__file__).parent.resolve() + long_description = (here / 'README.md').read_text(encoding='utf-8') def get_packages(package): """ @@ -36,23 +36,27 @@ def get_packages(package): module_name="halfapi" setup( name=module_name, - python_requires=">=3.7", version=get_version(module_name), - url="https://gite.lirmm.fr/newsi/api/halfapi", + url="https://gite.lirmm.fr/malves/halfapi", long_description=get_long_description(), long_description_content_type="text/markdown", packages=get_packages(module_name), - package_data={ - 'halfapi': ['lib/*', 'models/*'] - }, + python_requires=">=3.7", install_requires=[ - "click", "half_orm", "jwt", "starlette", - "uvicorn"], + ], extras_require={ - "tests":["pytest", "requests"], + "tests":[ + "pytest", + "requests" + ], + "cli":[ + "click", + "pygit2", + "uvicorn" + ] }, entry_points={ "console_scripts":[