-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
56 lines (50 loc) · 2.22 KB
/
Copy pathsetup.py
File metadata and controls
56 lines (50 loc) · 2.22 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import os
import setuptools
import configparser
ROOT_PATH = os.path.abspath(__file__).split(os.path.basename(__file__))[0]
README_FILE = os.path.join(ROOT_PATH, 'README.md')
CONFIG_FILE = os.path.join(ROOT_PATH, 'setup.cfg')
REQUIREMENTS_FILE = os.path.join(ROOT_PATH, 'requirements.txt')
# Read requirements from requirements.txt
REQUIREMENTS_LIST = []
if os.path.isfile(REQUIREMENTS_FILE):
with open(REQUIREMENTS_FILE, 'r') as f:
REQUIREMENTS_LIST = [line.strip() for line in f if line.strip() and not line.startswith('#')]
# Read metadata from setup.cfg
config = configparser.ConfigParser()
config.read(CONFIG_FILE)
PKG_NAME = config['metadata'].get('name', 'anylog-api')
PKG_VERSION = config['metadata'].get('version', '0.0.1')
PKG_AUTHOR = config['metadata'].get('author', 'AnyLog Co.')
PKG_CONTACT = config['metadata'].get('contact', 'info@anylog.co')
PKG_DESCRIPTION = config['metadata'].get('description', 'Tool for AnyLog / EdgeLake RESTful API')
# Define the entry point for running the package (if applicable)
ENTRY_POINTS = {
'console_scripts': [
'anylog-api = anylog_api.anylog_connector:main', # Update if there's a CLI entry point
],
}
setuptools.setup(
name=PKG_NAME,
version=PKG_VERSION,
author=PKG_AUTHOR,
author_email=PKG_CONTACT,
description=PKG_DESCRIPTION,
long_description=open(README_FILE).read() if os.path.isfile(README_FILE) else "",
long_description_content_type="text/markdown",
url=config["metadata"].get("source", "https://github.com/AnyLog-co/AnyLog-API"),
packages=setuptools.find_packages(exclude=("tests", "tests.*")),
include_package_data=True,
install_requires=REQUIREMENTS_LIST, # Installs dependencies from requirements.txt
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
"Operating System :: OS Independent",
],
python_requires=">=3.6",
project_urls={
"Bug Tracker": "https://github.com/AnyLog-co/AnyLog-API/issues",
"Documentation": config["metadata"].get("docs", "https://github.com/AnyLog-co/documentation"),
"Source Code": config["metadata"].get("source", "https://github.com/AnyLog-co/AnyLog-API"),
},
)