openCom-Companion/setup.py

119 lines
3.5 KiB
Python
Raw Normal View History

2022-07-08 13:12:32 +02:00
import os
import re
2022-04-07 21:03:53 +02:00
import setuptools
2022-10-03 13:00:13 +02:00
from pathlib import Path
2022-04-07 21:03:53 +02:00
with open("README.md", "r") as fh:
long_description = fh.read()
2022-07-08 13:12:32 +02:00
def get_version() -> str:
version_file = os.path.join(
os.path.dirname(__file__), "sbapp", "main.py"
)
version_file_data = open(version_file, "rt", encoding="utf-8").read()
version_regex = r"(?<=^__version__ = ['\"])[^'\"]+(?=['\"]$)"
try:
version = re.findall(version_regex, version_file_data, re.M)[0]
return version
except IndexError:
raise ValueError(f"Unable to find version string in {version_file}.")
def get_variant() -> str:
version_file = os.path.join(
os.path.dirname(__file__), "sbapp", "main.py"
)
version_file_data = open(version_file, "rt", encoding="utf-8").read()
version_regex = r"(?<=^__variant__ = ['\"])[^'\"]+(?=['\"]$)"
try:
version = re.findall(version_regex, version_file_data, re.M)[0]
return version
except IndexError:
2024-09-24 13:35:56 +02:00
return None
2022-07-08 13:12:32 +02:00
__version__ = get_version()
__variant__ = get_variant()
2022-10-03 13:00:13 +02:00
def glob_paths(pattern):
out_files = []
src_path = os.path.join(os.path.dirname(__file__), "kivymd")
for root, dirs, files in os.walk(src_path):
for file in files:
if file.endswith(pattern):
filepath = os.path.join(str(Path(*Path(root).parts[1:])), file)
out_files.append(filepath.split(f"kivymd{os.sep}")[1])
return out_files
2024-06-06 13:51:25 +02:00
packages = setuptools.find_packages(
exclude=[
"sbapp.plyer.platforms.android",
"sbapp.kivymd.tools"
"sbapp.kivymd.tools.*"
])
2022-10-03 13:00:13 +02:00
package_data = {
"": [
"assets/*",
2024-01-05 19:50:13 +01:00
"assets/fonts/*",
2024-03-26 15:26:24 +01:00
"assets/geoids/*",
2022-10-03 13:00:13 +02:00
"kivymd/fonts/*",
"kivymd/images/*",
"kivymd/*",
2023-11-01 01:17:19 +01:00
"mapview/icons/*",
2022-10-03 13:00:13 +02:00
*glob_paths(".kv")
]
}
2024-09-24 13:35:56 +02:00
variant_str = ""
if __variant__:
variant_str = " "+__variant__
print("Packaging openCom Companion "+__version__+variant_str)
2022-07-08 13:12:32 +02:00
2022-04-07 21:03:53 +02:00
setuptools.setup(
2024-09-16 16:41:37 +02:00
name="occ",
2022-04-07 21:03:53 +02:00
version=__version__,
2024-09-16 16:41:37 +02:00
author="Liberated Embedded Systems",
author_email="contact@liberatedsystems.co.uk",
2022-04-07 21:03:53 +02:00
description="LXMF client for Android, Linux and macOS allowing you to communicate with people or LXMF-compatible systems over Reticulum networks using LoRa, Packet Radio, WiFi, I2P, or anything else Reticulum supports.",
long_description=long_description,
long_description_content_type="text/markdown",
2024-09-16 16:41:37 +02:00
url="https://git.liberatedsystems.co.uk/jacob.eva/opencom_companion",
2024-06-06 13:51:25 +02:00
packages=packages,
2022-10-03 13:00:13 +02:00
package_data=package_data,
2022-07-13 10:53:07 +02:00
include_package_data=True,
2022-04-07 21:03:53 +02:00
classifiers=[
"Programming Language :: Python :: 3",
"License :: Other/Proprietary License",
"Operating System :: OS Independent",
],
2024-05-05 14:24:18 +02:00
data_files = [
2024-09-16 16:41:37 +02:00
('share/applications', ['sbapp/assets/uk.co.liberatedsystems.occ.desktop']),
('share/icons/hicolor/512x512/apps', ['sbapp/assets/uk.co.liberatedsystems.occ.png']),
2024-05-05 14:24:18 +02:00
],
2022-04-07 21:03:53 +02:00
entry_points= {
'console_scripts': [
2022-07-07 22:16:10 +02:00
'sideband=sbapp:main.run',
2022-04-07 21:03:53 +02:00
]
},
install_requires=[
2024-10-10 23:38:46 +02:00
"rns>=0.8.4",
2024-10-13 14:36:21 +02:00
"lxmf>=0.5.7",
"kivy>=2.3.0",
"pillow>=10.2.0",
"qrcode",
"materialyoucolor>=2.0.7",
"ffpyplayer",
2024-06-04 18:12:08 +02:00
"sh",
2024-06-29 13:50:46 +02:00
"numpy<=1.26.4",
2024-06-04 15:50:12 +02:00
"pycodec2;platform_system!='Windows'",
"pyaudio;sys.platform=='linux'",
"pyobjus;sys.platform=='darwin'",
"pyogg;sys.platform=='darwin'",
"pyogg;platform_system=='Windows'",
],
2023-11-01 17:29:16 +01:00
python_requires='>=3.7',
2022-04-07 21:03:53 +02:00
)