GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Failed
Push — master ( d1d321...b9074d )
by Virantha
01:42
created

setup   A

Complexity

Total Complexity 11

Size/Duplication

Total Lines 93
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 74
dl 0
loc 93
rs 10
c 0
b 0
f 0
wmc 11

3 Methods

Rating   Name   Duplication   Size   Complexity  
A PyTest.run() 0 7 1
A PyTest.finalize_options() 0 2 1
A PyTest.initialize_options() 0 2 1

1 Function

Rating   Name   Duplication   Size   Complexity  
B read() 0 20 8
1
from __future__ import print_function
2
from setuptools import setup, find_packages
3
4
import io
5
import os
6
from setuptools import Command
7
#from bricknil.version import __version__
8
9
10
# Load the package's __version__.py module as a dictionary.
11
here = os.path.abspath(os.path.dirname(__file__))
12
about = {}
13
with open(os.path.join(here, 'bricknil', 'version.py')) as f:
14
    exec(f.read(), about)
15
16
class PyTest(Command):
17
    user_options = []
18
    def initialize_options(self):
19
        pass
20
    def finalize_options(self):
21
        pass
22
    def run(self):
23
        import sys,subprocess
24
        cwd = os.getcwd()
25
        os.chdir('test')
26
        errno = subprocess.call([sys.executable, 'runtests.py'])
27
        os.chdir(cwd)
28
        raise SystemExit(errno)
29
30
def read(*filenames, **kwargs):
31
    encoding = kwargs.get('encoding', 'utf-8')
32
    sep = kwargs.get('sep', '\n')
33
    buf = []
34
    for filename in filenames:
35
        with io.open(filename, encoding=encoding) as f:
36
            headline_count = 0
37
            found_features = False
38
            for line in f.readlines():
39
                # Keep reading until we find the first headline
40
                # after Features
41
                if line.startswith('Features'):
42
                    found_features = True
43
                if line.startswith('####'):
44
                    headline_count += 1
45
                if found_features and headline_count == 2:
46
                    break
47
                else:
48
                    buf.append(line.rstrip())
49
    return sep.join(buf)
50
51
packages = find_packages(exclude="tests")
52
53
long_description = read('README.rst')
54
print(long_description)
55
56
required = []
57
dependency_links = []
58
with open("requirements.txt") as f:
59
    for line in f.read().splitlines():
60
        if line.startswith('git'):
61
            _, url = line.split('+')
62
            pkg_name = url[url.index('=')+1:]
63
            dependency_links.append(url)
64
            required.append(pkg_name)
65
        else:
66
            required.append(line)
67
68
69
setup (
70
    name = "bricknil",
71
    version = about['__version__'],
72
    description="Control LEGO(tm) BluetoothLE Hubs, Motors, and Sensors using Async Python",
73
    license = "ASL 2.0",
74
    long_description = long_description,
75
    author="Virantha N. Ekanayake",
76
    author_email="[email protected]", # Removed.
77
    package_data = {'': ['*.xml']},
78
    zip_safe = True,
79
    include_package_data = True,
80
    packages = packages,
81
    install_requires = required + ['pyobjc ; sys.platform == "darwin"',
82
                                   'bricknil-bleak ; sys.platform != "darwin"'],
83
    dependency_links = dependency_links,
84
    entry_points = {
85
            'console_scripts': [
86
                    'bricknil = bricknil.bricknil:main'
87
                ],
88
        },
89
    options = {
90
	    "pyinstaller": {"packages": packages}
91
	    },
92
    cmdclass = {'test':PyTest}
93
94
)
95