~dricottone/huttese-apk

ref: 09a6934a829363b8ebddd2816812cb170b68ee19 huttese-apk/sr.ht/py3-colour/setup.py -rw-r--r-- 1.9 KiB
09a6934a — Drew DeVault py3-gitlab: upgrade to 3.1.0 2 years ago
                                                                                
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
#!/usr/bin/env python

##
## You can download latest version of this file:
##  $ wget https://gist.github.com/vaab/e0eae9607ae806b662d4/raw -O setup.py
##  $ chmod +x setup.py
##
## This setup.py is meant to be run along with ``./autogen.sh`` that
## you can also find here: https://gist.github.com/vaab/9118087/raw
##

try:
    from setuptools import setup
except ImportError:
    from distribute_setup import use_setuptools
    use_setuptools()
    from setuptools import setup

##
## Ensure that ``./autogen.sh`` is run prior to using ``setup.py``
##

if "0.1.5".startswith("%%"):
    import os.path
    import sys
    WIN32 = sys.platform == 'win32'
    autogen = os.path.join(".", "autogen.sh")
    if not os.path.exists(autogen):
        sys.stderr.write(
            "This source repository was not configured.\n"
            "Please ensure ``./autogen.sh`` exists and that you are running "
            "``setup.py`` from the project root directory.\n")
        sys.exit(1)
    if os.path.exists('.autogen.sh.output'):
        sys.stderr.write(
            "It seems that ``./autogen.sh`` couldn't do its job as expected.\n"
            "Please try to launch ``./autogen.sh`` manualy, and send the "
            "results to the\nmaintainer of this package.\n"
            "Package will not be installed !\n")
        sys.exit(1)
    sys.stderr.write("Missing version information: "
                     "running './autogen.sh'...\n")
    import os
    import subprocess
    os.system('%s%s > .autogen.sh.output'
              % ("bash " if WIN32 else "",
                 autogen))
    cmdline = sys.argv[:]
    if cmdline[0] == "-c":
        ## for some reason, this is needed when launched from pip
        cmdline[0] = "setup.py"
    errlvl = subprocess.call(["python", ] + cmdline)
    os.unlink(".autogen.sh.output")
    sys.exit(errlvl)


setup(extras_require={'test': ['nose', ]})