<commit_before>from setuptools import find_packages, setup
from great import __url__
setup(
    url=__url__,
    packages=find_packages() + ["twisted.plugins"],
    use_scm_version=True,
)<commit_msg>First pass at starting to get the frontend stuff into setup.py.<commit_after>import distutils.command.build
import os
import setuptools

from great import __url__


HERE = os.path.abspath(os.path.dirname(__file__))
FRONTEND = os.path.join(HERE, "frontend")
STATIC = os.path.join(HERE, "great", "static")


class BuildFrontend(setuptools.Command):

    description = "build the Great frontend"
    user_options = []

    def initialize_options(self):
        pass

    def run(self):
        self.spawn(
            [
                "npm",
                "--prefix", FRONTEND,
                "run-script", "build:dev",
                "--",
                "--output-public-path", "/static/",
                "--output-path", STATIC,
            ],
        )

    def finalize_options(self):
        pass


setuptools.setup(
    url=__url__,
    packages=setuptools.find_packages() + ["twisted.plugins"],
    use_scm_version=True,
    cmdclass={
        "build_frontend": BuildFrontend,
    },
)
{'fraction_non_alphanumeric': 0.12280701754385964, 'fraction_numerical': 0.0, 'mean_word_length': 2.46242774566474, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2688046', 'n_tokens_mistral': 378, 'n_tokens_neox': 363, 'n_words': 77}