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


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


test_requires = [
    "empty_testproject",
    "pylint-django",
    "isort",
    "ruff",
    "vdt.versionplugin.wheel",
    "ocyan.plugin.testing",
    "coverage",
]

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

setup(
    name="oxyan.themes",
    version="2.0.1",
    url="https://git.mandelblog.com/mandel-plugins/oxyan.themes",
    author="Mandel",
    author_email="info@mandelblog.com",
    description="Ocyan application framework themes 2.0",
    packages=find_packages(exclude=["ez_setup", "sandbox", "tests"]),
    include_package_data=True,
    python_requires=">=3.6",
    install_requires=[
        "django",
        "django-oscar>2.0",
        "wagtail",
        "ocyan.plugin.wagtail",
        "ocyan.main",
        "django-compressor",
        "django-libsass",
        "sorl-thumbnail",
        "ocyan.plugin.seo",
    ],
    extras_require={
        "develop": {"wagtailfontawesome", "wagtailmenus", "wagtail-metadata"},
        "test": test_requires,
    },
    cmdclass={"build": BuildNPM},
    classifiers=PACKAGE_CLASSIFIERS,
)
