#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from __init__ import HOME, REPO, readlines

__all__ = ["classifiers"]

classifiers = []
# ~/.classifiers.txt (default)
# ./.classifiers.txt, ./classifiers.txt (custom)
for path in [
        os.path.join(HOME, ".classifiers.txt"),
        os.path.join(REPO, ".classifiers.txt"),
        os.path.join(REPO, "classifiers.txt")]:
    if os.path.exists(path) and os.path.isfile(path):
        for l in readlines(path):
            if l and " :: " in l and "#" not in l:
                classifiers.append(l)
classifiers = sorted(list(set(classifiers)))
if "CLASSIFIERS" in os.environ:
    classifiers += os.environ["CLASSIFIERS"].splitlines()


if __name__ == "__main__":
    for k in __all__:
        if k in globals():
            print("%s: %s" % (k, globals()[k]))
#!/usr/bin/env python
# setuptools setup(...,entry_points=[]) keyword
import os
from __init__ import REPO, readlines

__all__ = ["entry_points"]

# ./entry_points.txt
path = os.path.join(REPO, "entry_points.txt")
if os.path.exists(path) and os.path.isfile(path):
    entry_points = readlines(path)
else:
    if __name__ == "__main__":
        print("SKIP: %s NOT EXISTS" % path)

if __name__ == "__main__":
    for k in __all__:
        if k in globals():
            print("%s: %s" % (k, globals()[k]))
#!/usr/bin/env python
# setuptools setup(...,dependency_links=[]) keyword
import os
from __init__ import REPO, readlines

__all__ = ["dependency_links"]

dependency_links = []
filenames = ["dependency_links.txt", "dependency.txt"]
for filename in filenames:
    path = os.path.join(REPO, filename)
    dependency_links += readlines(path)

if __name__ == "__main__":
    for k in __all__:
        if k in globals():
            print("%s: %s" % (k, globals()[k]))
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from __init__ import readlines

__all__ = ["classifiers"]

HOME = os.environ["HOME"]

classifiers = []
# ~/.classifiers.txt (default)
default = readlines(os.path.join(HOME, ".classifiers.txt"))
# ./.classifiers.txt, ./classifiers.txt (custom, override default)
custom = readlines(".classifiers.txt") + readlines("classifiers.txt")
for l in custom:
    if l.find(" :: ") > 0:
        k = l.split(" :: ")[0]
        default = list(filter(lambda l: l.find(k) != 0, default))
classifiers = sorted(default + custom)

if __name__ == "__main__":
    for k in __all__:
        if k in globals():
            print("%s: %s" % (k, globals()[k]))
#!/usr/bin/env python
# setuptools setup(...,install_requires=[]) keyword
# checks that the requirements installed
# raise exception if requirements not installed:
# error: Could not find required distribution <name>
# fix - install requirements.txt first:
# 1) pip install -U <name>
# 2) pip install -r requirements.txt; python install setup.py
import os
from __init__ import REPO, readlines

__all__ = ["install_requires"]

filenames = ["requirements.txt", "requires.txt", "install_requires.txt"]
for filename in filenames:
    path = os.path.join(REPO, filename)
    if os.path.exists(path):
        install_requires = readlines(path)
        if install_requires:
            break

if __name__ == "__main__":
    for k in __all__:
        if k in globals():
            print("%s: %s" % (k, globals()[k]))