improve setup
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 11 Sep 2020 12:12:53 +0000 (14:12 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Fri, 11 Sep 2020 12:12:53 +0000 (14:12 +0200)
music_assistant/constants.py
setup.py

index f86c72cfe7e5e6e4f2a0ff6e0041b620e8c7f106..0619e1c473e676a51ec42827756569e0ad0b9b0d 100755 (executable)
@@ -1,5 +1,7 @@
-#!/usr/bin/env python3
-# -*- coding:utf-8 -*-
+"""All constants for Music Assistant."""
+
+__version__ = 1.0.0
+REQUIRED_PYTHON_VER = 3.7
 
 CONF_USERNAME = "username"
 CONF_PASSWORD = "password"
index 145fdd8d28f263f30945faa8c8499d15926d6aad..62b689bf3d4956baefe70fd7be1d5e074366af54 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,47 +1,52 @@
-from pathlib import Path
-import os
+"""Music Assistant setup."""
+from datetime import datetime as dt
 
-from setuptools import setup, glob, find_packages
+from setuptools import find_packages, setup
 
-PROJECT_DIR = Path(__file__).parent.resolve()
-README_FILE = PROJECT_DIR / "README.md"
-VERSION = "0.0.20"
+import music_assistant.const as mass_const
+
+PROJECT_NAME = "Music Assistant"
+PROJECT_PACKAGE_NAME = "music_assistant"
+PROJECT_LICENSE = "Apache License 2.0"
+PROJECT_AUTHOR = "Marcel van der Veldt"
+PROJECT_COPYRIGHT = f" 2019-{dt.now().year}, {PROJECT_AUTHOR}"
+PROJECT_URL = "https://music-assistant.github.io/"
+PROJECT_EMAIL = "marcelveldt@users.noreply.github.com"
+
+PROJECT_GITHUB_USERNAME = "music-assistant"
+PROJECT_GITHUB_REPOSITORY = "server"
+
+PYPI_URL = f"https://pypi.python.org/pypi/{PROJECT_PACKAGE_NAME}"
+GITHUB_PATH = f"{PROJECT_GITHUB_USERNAME}/{PROJECT_GITHUB_REPOSITORY}"
+GITHUB_URL = f"https://github.com/{GITHUB_PATH}"
+
+DOWNLOAD_URL = f"{GITHUB_URL}/archive/{mass_const.__version__}.zip"
+PROJECT_URLS = {
+    "Bug Reports": f"{GITHUB_URL}/issues",
+    "Website": "https://music-assistant.github.io/",
+    "Discord": "https://discord.gg/9xHYFY"
+}
+
+PACKAGES = find_packages(exclude=["tests", "tests.*"])
 
 with open("requirements.txt") as f:
-    INSTALL_REQUIRES = f.read().splitlines()
+    REQUIRES = f.read().splitlines()
 if os.name != "nt":
-    INSTALL_REQUIRES.append("uvloop")
-
-PACKAGE_FILES = []
-for (path, directories, filenames) in os.walk('music_assistant/'):
-    for filename in filenames:
-        PACKAGE_FILES.append(os.path.join('..', path, filename))
+    REQUIRES.append("uvloop")
 
 setup(
-    name="music_assistant",
-    version=VERSION,
-    url="https://github.com/marcelveldt/musicassistant",
-    download_url="https://github.com/marcelveldt/musicassistant",
-    author="Marcel van der Veldt",
-    author_email="m.vanderveldt@outlook.com",
-    description="Music library manager and player based on sox.",
-    long_description=README_FILE.read_text(encoding="utf-8"),
-    long_description_content_type="text/markdown",
-    packages=find_packages(exclude=["test.*", "test", "frontend", "frontend.*", ".vscode", ".vscode*"]),
-    python_requires=">=3.7",
+    name=PROJECT_PACKAGE_NAME,
+    version=mass_const.__version__,
+    url=PROJECT_URL,
+    download_url=DOWNLOAD_URL,
+    project_urls=PROJECT_URLS,
+    author=PROJECT_AUTHOR,
+    author_email=PROJECT_EMAIL,
+    packages=PACKAGES,
     include_package_data=True,
-    install_requires=INSTALL_REQUIRES,
-    package_data={
-        'music_assistant': PACKAGE_FILES,
-    },
     zip_safe=False,
-    classifiers=[
-        "Development Status :: 4 - Beta",
-        "Intended Audience :: Developers",
-        "Natural Language :: English",
-        "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.7",
-        "Programming Language :: Python :: 3.8",
-        "Topic :: Home Automation",
-    ],
+    install_requires=REQUIRES,
+    python_requires=f">={MIN_PY_VERSION}",
+    test_suite="tests",
+    entry_points={"console_scripts": ["mass = music_assistant.__main__:main", "musicassistant = music_assistant.__main__:main"]},
 )