# -*- coding: utf-8 -*-
import subprocess
# pylint: disable=deprecated-module
from distutils.command import build as build_module
from setuptools import find_packages, setup

install_requires: list = [
    "ocyan.core",
    "ocyan.plugin.wagtail",
    "wagtail-roadrunner",
]

extras_require: dict = {
    "test": [
        "ocyan.plugin.testing",
        "wheel",
        "empty_testproject",
        "pylint-django",
        "ruff",
        "vdt.versionplugin.wheel",
        "coverage",
        "ocyan.plugin.coyote",
    ]
}

PACKAGE_CLASSIFIERS = [
    "License :: Other/Proprietary License",
    "Framework :: Ocyan",
    "Environment :: Plugins",
]

class BuildNPM(build_module.build):
    def run(self):
        subprocess.check_call(["npm", "install"])
        subprocess.check_call(["npm", "run", "build"])
        super().run()


setup(
    name="ocyan.plugin.roadrunner_bs5",
    version="0.2.1",
    url="https://git.mandelblog.com/mandel-plugins/ocyan.plugin.roadrunner_bs5",
    author="Mandel",
    author_email="info@mandelblog.com",
    description="Adds roadrunner page editor for wagtail with bootstrap 5 support.",
    packages=find_packages(),
    include_package_data=True,
    python_requires=">=3.6",
    install_requires=install_requires,
    classifiers=PACKAGE_CLASSIFIERS,
    extras_require=extras_require,
    cmdclass={"build": BuildNPM},
)
