setup   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 100
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 62
dl 0
loc 100
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A fetch_reqs() 0 6 3
1
"""
2
 *  PyDMXControl: A Python 3 module to control DMX using OpenDMX or uDMX.
3
 *                Featuring fixture profiles, built-in effects and a web control panel.
4
 *  <https://github.com/MattIPv4/PyDMXControl/>
5
 *  Copyright (C) 2022 Matt Cowley (MattIPv4) ([email protected])
6
 *
7
 *  This program is free software: you can redistribute it and/or modify
8
 *   it under the terms of the GNU General Public License as published
9
 *   by the Free Software Foundation, either version 3 of the License, or
10
 *   (at your option) any later version.
11
 *  This program is distributed in the hope that it will be useful,
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 *   GNU General Public License for more details.
15
 *  You should have received a copy of the GNU General Public License
16
 *   along with this program. If not, please see
17
 *   <https://github.com/MattIPv4/PyDMXControl/blob/master/LICENSE> or <http://www.gnu.org/licenses/>.
18
"""
19
20
from typing import List
21
import re
22
23
from setuptools import setup, find_packages
24
25
26
def fetch_reqs(base: str = "") -> List[str]:
27
    if base:
28
        base = "PyDMXControl/{}/".format(base)
29
    with open(base + "requirements.txt", "r") as file:
30
        requirements = file.read().splitlines()
31
    return requirements
32
33
34
data = {}
35
with open("PyDMXControl/__init__.py") as file:
36
    for match in re.finditer(r'^__(.+)__\s*=\s*[\'"](.+)[\'"]$', file.read(), re.MULTILINE):
37
        data[match.group(1)] = match.group(2)
38
39
with open("README.md", "r") as f:
40
    readme = f.read()
41
42
setup(
43
    name=data["title"],
44
    author=data["author"],
45
    author_email=data["email"],
46
    url="https://github.com/MattIPv4/PyDMXControl/",
47
    version=data["version"],
48
    license=data["license"],
49
    packages=find_packages(),
50
    python_requires=">= 3.6",
51
    include_package_data=True,
52
    install_requires=fetch_reqs(),
53
    extras_require={
54
        "audio": fetch_reqs("audio")
55
    },
56
    description="A Python 3 module to control DMX using OpenDMX or uDMX."
57
                " Featuring fixture profiles, built-in effects and a web control panel.",
58
    long_description=readme,
59
    long_description_content_type="text/markdown",
60
    keywords="lighting light lights "
61
             "fixtures fixture-profiles "
62
             "controller control control-dmx "
63
             "dmx dmx-512 dmx-interface dmx-channels dmx-dimmer dmx-library "
64
             "theatre udmx opendmx open-dmx ftdi",
65
    classifiers=[
66
        "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
67
68
        "Programming Language :: Python :: 3",
69
        "Programming Language :: Python :: 3.6",
70
        "Programming Language :: Python :: 3.7",
71
        "Programming Language :: Python :: 3.8",
72
        "Programming Language :: Python :: 3.9",
73
        "Programming Language :: Python :: 3.10",
74
        "Programming Language :: Python :: 3.11",
75
76
        "Development Status :: 5 - Production/Stable",
77
        "Intended Audience :: Developers",
78
        "Intended Audience :: Other Audience",
79
80
        "Environment :: Console",
81
        "Environment :: Web Environment",
82
        "Framework :: Flask",
83
84
        "Natural Language :: English",
85
        "Operating System :: OS Independent",
86
87
        "Topic :: Home Automation",
88
        "Topic :: Internet",
89
        "Topic :: Multimedia",
90
        "Topic :: Software Development :: Embedded Systems",
91
        "Topic :: Software Development :: Libraries :: Python Modules",
92
        "Topic :: Software Development :: User Interfaces",
93
    ],
94
    project_urls={
95
        "Source": "https://github.com/MattIPv4/PyDMXControl/tree/master",
96
        "Funding": "https://patreon.mattcowley.co.uk/",
97
        "Issues": "https://github.com/MattIPv4/PyDMXControl/issues",
98
        "Discord": "https://discord.mattcowley.co.uk/",
99
        "Slack": "https://slack.mattcowley.co.uk/",
100
    },
101
)
102
103
# How2Ship:tm:
104
# Update version in PyDMXControl/__init__.py
105
# Run `rm -rf dist/ build/ PyDMXControl.egg-info/`
106
# Run `python3 -m pip install --upgrade setuptools build twine`
107
# Run `python3 -m build`
108
# Run `python3 -m twine upload dist/*`
109