File: __init__.py

package info (click to toggle)
python-rcssmin 1%3A1.1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,196 kB
  • sloc: python: 2,379; ansic: 1,216; sh: 110; makefile: 20
file content (131 lines) | stat: -rw-r--r-- 4,075 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# -*- encoding: ascii -*-
"""
invoke tasks
~~~~~~~~~~~~

"""


def namespace():
    """ Create invoke task namespace """

    class adict(object):
        """ attribute dict """
        # pylint: disable = invalid-name, missing-docstring

        def __init__(self, *args, **kwargs):
            self.__x__ = dict(*args, **kwargs)

        def __getitem__(self, name):
            return self.__x__[name]

        def __getattr__(self, name):
            if name == '__setstate__':
                raise AttributeError(name)
            try:
                return self.__x__[name]
            except KeyError:
                raise AttributeError(name)

        def items(self):
            return self.__x__.items()

    import os as _os
    import sys as _sys

    from . import _shell

    def fail(msg):
        """ Exit with message """
        _sys.stderr.write('Error: %s\n' % (msg,))
        raise _invoke.Exit(1)

    env = adict(
        package='rcssmin',
        test=adict(ignore=[]),
        doc=adict(
            userdoc="docs/userdoc",
            website=adict(
                source="docs/website",
                target="dist/website",
            ),

            sphinx=adict(
                build='docs/_userdoc/_build',
                source='docs/_userdoc',
            ),
        ),
        wheels=dict(
            build="binary",
            specs={
                "aarch64": {
                    "36": dict(manylinux="2014", musllinux="1_1"),
                    "37": dict(manylinux="2014", musllinux="1_1"),
                    "38": dict(manylinux="2014", musllinux="1_1"),
                    "39": dict(manylinux="2014", musllinux="1_1"),
                    "310": dict(manylinux="2014", musllinux="1_1"),
                    "311": dict(manylinux="2014", musllinux="1_1"),
                    "312": dict(manylinux="2014", musllinux="1_1"),
                },
                "x86_64": {
                    "27": dict(manylinux="1"),
                    "36": dict(manylinux="1", musllinux="1_1"),
                    "37": dict(manylinux="1", musllinux="1_1"),
                    "38": dict(manylinux="1", musllinux="1_1"),
                    "39": dict(manylinux="1", musllinux="1_1"),
                    "310": dict(manylinux="2010", musllinux="1_1"),
                    "311": dict(manylinux="2014", musllinux="1_1"),
                    "312": dict(manylinux="2014", musllinux="1_1"),
                },
                "i686": {
                    "27": dict(manylinux="1"),
                    "36": dict(manylinux="1", musllinux="1_1"),
                    "37": dict(manylinux="1", musllinux="1_1"),
                    "38": dict(manylinux="1", musllinux="1_1"),
                    "39": dict(manylinux="1", musllinux="1_1"),
                    "310": dict(manylinux="2010", musllinux="1_1"),
                    "311": dict(manylinux="2014", musllinux="1_1"),
                    "312": dict(manylinux="2014", musllinux="1_1"),
                },
            },
        ),
        pypi=adict(
            # repository='https://test.pypi.org/legacy/',
            repository='https://upload.pypi.org/legacy/',
            username='__token__',
        ),

        shell=adict((key, value) for key, value in vars(_shell).items()
                    if not key.startswith('_')),
        c=_shell.command,
        q=lambda x: _shell.command('%s', x),
        fail=fail,
    )

    _sys.path.insert(0, _os.path.dirname(
        _os.path.dirname(_os.path.abspath(__file__))
    ))

    class Vars(object):
        """ Submodules container """
        from . import (  # noqa
            benchmark,
            build,
            check,
            clean,
            compile,
            deps,
            doc,
            format,
            test,
            upload,
        )

    import invoke as _invoke

    result = _invoke.Collection(*[value for key, value in vars(Vars).items()
                                  if not key.startswith('__')])
    result.configure(env)
    return result

namespace = namespace()