Sideband/setup.py

133 lines
3.9 KiB
Python
Raw Normal View History

2022-07-08 05:12:32 -06:00
import os
import re
2022-04-07 13:03:53 -06:00
import setuptools
2022-10-03 05:00:13 -06:00
from pathlib import Path
2022-04-07 13:03:53 -06:00
with open("README.md", "r") as fh:
long_description = fh.read()
2022-07-08 05:12:32 -06: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 05:35:56 -06:00
return None
2022-07-08 05:12:32 -06:00
__version__ = get_version()
__variant__ = get_variant()
2022-10-03 05:00:13 -06: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-12-10 13:18:52 -07:00
def glob_share():
out_files = []
src_path = os.path.join(os.path.dirname(__file__), "sbapp/share")
print(src_path)
for root, dirs, files in os.walk(src_path):
for file in files:
filepath = os.path.join(str(Path(*Path(root).parts[1:])), file)
if not "mirrors/unsigned.io" in str(filepath):
out_files.append(filepath.split(f"sbapp{os.sep}")[1])
return out_files
2024-06-06 05:51:25 -06:00
packages = setuptools.find_packages(
exclude=[
"sbapp.plyer.platforms.android",
"sbapp.kivymd.tools"
"sbapp.kivymd.tools.*"
])
2022-10-03 05:00:13 -06:00
package_data = {
"": [
"assets/*",
2024-01-05 11:50:13 -07:00
"assets/fonts/*",
2024-03-26 08:26:24 -06:00
"assets/geoids/*",
2022-10-03 05:00:13 -06:00
"kivymd/fonts/*",
"kivymd/images/*",
"kivymd/*",
2023-10-31 18:17:19 -06:00
"mapview/icons/*",
2024-12-10 13:18:52 -07:00
*glob_share(),
2022-10-03 05:00:13 -06:00
*glob_paths(".kv")
]
}
2024-09-24 05:35:56 -06:00
variant_str = ""
if __variant__:
variant_str = " "+__variant__
print("Packaging Sideband "+__version__+variant_str)
2022-07-08 05:12:32 -06:00
2022-04-07 13:03:53 -06:00
setuptools.setup(
2022-07-07 14:16:10 -06:00
name="sbapp",
2022-04-07 13:03:53 -06:00
version=__version__,
author="Mark Qvist",
author_email="mark@unsigned.io",
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",
url="https://unsigned.io/sideband",
2024-06-06 05:51:25 -06:00
packages=packages,
2022-10-03 05:00:13 -06:00
package_data=package_data,
2022-07-13 02:53:07 -06:00
include_package_data=True,
2022-04-07 13:03:53 -06:00
classifiers=[
"Programming Language :: Python :: 3",
"License :: Other/Proprietary License",
"Operating System :: OS Independent",
],
2024-05-05 06:24:18 -06:00
data_files = [
('share/applications', ['sbapp/assets/io.unsigned.sideband.desktop']),
('share/icons/hicolor/512x512/apps', ['sbapp/assets/io.unsigned.sideband.png']),
],
2022-04-07 13:03:53 -06:00
entry_points= {
'console_scripts': [
2022-07-07 14:16:10 -06:00
'sideband=sbapp:main.run',
2022-04-07 13:03:53 -06:00
]
},
install_requires=[
2024-12-07 13:28:59 -07:00
"rns>=0.8.7",
2024-11-25 12:59:50 -07:00
"lxmf>=0.5.8",
"kivy>=2.3.0",
"pillow>=10.2.0",
"qrcode",
"materialyoucolor>=2.0.7",
"ffpyplayer",
2024-06-04 10:12:08 -06:00
"sh",
2024-06-29 05:50:46 -06:00
"numpy<=1.26.4",
2024-11-26 06:46:01 -07:00
"pycodec2;sys.platform!='Windows' and sys.platform!='win32' and sys.platform!='darwin'",
"pyaudio;sys.platform=='linux'",
"pyobjus;sys.platform=='darwin'",
2024-11-26 06:46:01 -07:00
"pyogg;sys.platform=='Windows' and sys.platform!='win32'",
],
2023-11-01 10:29:16 -06:00
python_requires='>=3.7',
2022-04-07 13:03:53 -06:00
)