setup.py 2.42 KB
Newer Older
Mark Hewitt's avatar
Mark Hewitt committed
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
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

"""OSDU CLI package that can be installed using setuptools"""

# For reasons behind /src/ file structure see https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure

import os
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import setup, find_packages


def read(fname):
    """Local read helper function for long documentation"""
    osducli_path = dirname(os.path.realpath(__file__))
    return open(join(osducli_path, fname)).read()


version_file = read(os.path.join("src", "osducli", "__init__.py"))
__VERSION__ = re.search(
    r'^__VERSION__\s*=\s*[\'"]([^\'"]*)[\'"]', version_file, re.MULTILINE
).group(1)

setup(
    name="osducli",
    version=__VERSION__,
    description="OSDU command line",
    long_description=read("README.rst"),
Mark Hewitt's avatar
Mark Hewitt committed
43
    url="https://community.opengroup.org/osdu/platform/data-flow/data-loading/osdu-cli",
Mark Hewitt's avatar
Mark Hewitt committed
44
45
    author="Equinor ASA",
    author_email="mhew@equinor.com",
Mark Hewitt's avatar
Mark Hewitt committed
46
    license="Apache",
Mark Hewitt's avatar
Mark Hewitt committed
47
    classifiers=[
Mark Hewitt's avatar
Mark Hewitt committed
48
        "Development Status :: 3 - Alpha",
Mark Hewitt's avatar
Mark Hewitt committed
49
        "Environment :: Console",
Mark Hewitt's avatar
Mark Hewitt committed
50
        "License :: OSI Approved :: Apache Software License",
Mark Hewitt's avatar
Mark Hewitt committed
51
52
53
        "Natural Language :: English",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
Mark Hewitt's avatar
Mark Hewitt committed
54
        "Programming Language :: Python :: 3.10",
Mark Hewitt's avatar
Mark Hewitt committed
55
56
57
58
59
60
61
    ],
    keywords="osdu",
    python_requires=">=3.8",
    packages=find_packages("src"),
    package_dir={"": "src"},
    py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
    include_package_data=True,
Mark Hewitt's avatar
Mark Hewitt committed
62
    install_requires=["click", "jmespath", "osdu-sdk==0.0.9", "requests", "tabulate", "msal"],
Mark Hewitt's avatar
Mark Hewitt committed
63
    project_urls={
Mark Hewitt's avatar
Mark Hewitt committed
64
        "Issue Tracker": "https://community.opengroup.org/osdu/platform/data-flow/data-loading/osdu-cli/-/issues",
Mark Hewitt's avatar
Mark Hewitt committed
65
66
67
    },
    entry_points={"console_scripts": ["osdu=osducli.__main__:main"]},
)