setup.py 1.52 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/env python

import copy

from setuptools import setup
from setuptools.command.build_py import build_py


class BuildCmd(build_py):
    def run(self):
        # build foris plugin files
        from foris_plugins_distutils import build
Štěpán Henek's avatar
Štěpán Henek committed
13

14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
        cmd = build(copy.copy(self.distribution))
        cmd.ensure_finalized()
        cmd.run()

        # build package
        build_py.run(self)


setup(
    name="Foris Subordinates Plugin",
    version="0",
    description="Subordinates plugin for foris web interface",
    author="CZ.NIC, z. s. p. o.",
    author_email="stepan.henek@nic.cz",
    url="https://gitlab.labs.nic.cz/turris/foris-subordinates-plugin/",
    license="GPL-3.0",
Štěpán Henek's avatar
Štěpán Henek committed
30 31 32 33
    install_requires=["foris", "jinja2"],
    setup_requires=["babel", "libsass", "foris_plugins_distutils"],
    provides=["foris_plugins.subordinates"],
    packages=["foris_plugins.subordinates"],
34
    package_data={
Štěpán Henek's avatar
Štěpán Henek committed
35
        "": [
36 37 38 39 40 41 42 43 44 45
            "templates/**",
            "templates/**/*",
            "templates/javascript/**",
            "templates/javascript/**/*",
            "locale/**/LC_MESSAGES/*.mo",
            "static/css/*.css",
            "static/fonts/*",
            "static/img/*",
            "static/js/*.js",
            "static/js/contrib/*",
Štěpán Henek's avatar
Štěpán Henek committed
46
        ]
47
    },
Štěpán Henek's avatar
Štěpán Henek committed
48 49 50 51 52
    namespace_packages=["foris_plugins"],
    cmdclass={"build_py": BuildCmd},  # modify build_py to build the foris files as well
    dependency_links=[
        "git+https://gitlab.labs.nic.cz/turris/foris-plugins-distutils.git"
        "#egg=foris_plugins_distutils"
53 54
    ],
)