<commit_before>CURRENT_RELEASE = "43"

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from platform import architecture
from codecs import open

import os
from os import listdir, path

try:
    from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
    class bdist_wheel(_bdist_wheel):
        def finalize_options(self):
            _bdist_wheel.finalize_options(self)
            self.root_is_pure = False

        def get_tag(self):
            python, abi, plat = _bdist_wheel.get_tag(self)
            # We don't contain any python source
            python, abi = 'py2.py3', 'none'
            return python, abi, plat
except ImportError:
    bdist_wheel = None


is_win = (architecture()[1] == "WindowsPE")
is_64 = (architecture()[0] == "64bit")
here = path.abspath(path.dirname(__file__))

if not is_win:
    raise OSError("VapourSynth Portable is currently only supported on Windows Systems.")

if not os.path.exists(os.path.join(here, "VapourSynth.dll")):
    if is_64:
        subdir = "buildp64"
    else:
        subdir = "buildp32"
    build_dir = os.path.join(here, subdir)

    if not os.path.exists(os.path.join(build_dir, "VapourSynth.dll")):
        raise OSError("Failed to detect VapourSynth-portable build directory.")
else:
    subdir = "."
    build_dir = here

if is_64:
    plugin_subdir = 'vapoursynth64'
else:
    plugin_subdir = 'vapoursynth32'
plugin_dir = os.path.join(subdir, plugin_subdir)

setup(
    name = "VapourSynth-portable",
    version=CURRENT_RELEASE,
    description = "A frameserver for the 21st century",
    url = "http://www.vapoursynth.com/",
    download_url = "https://github.com/vapoursynth/vapoursynth",
    author = "<NAME>",
    author_email = "<EMAIL>",

    cmdclass={'bdist_wheel': bdist_wheel},

    packages=[],
    install_requires=["vapoursynth==" + CURRENT_RELEASE],
    setup_requires=["vapoursynth==" + CURRENT_RELEASE],
    data_files = [
        ("Lib\\site-packages", [
            os.path.join(build_dir, p)
            for p in os.listdir(build_dir)
            if p.endswith("140.dll") or \
               p.endswith(".vs")
        ]),

        ("Scripts", [
            os.path.join(build_dir, "VSPipe.exe"),
            os.path.join(build_dir, "VSScript.dll"),
            os.path.join(build_dir, "portable.vs")
        ]),

        ("Lib\\site-packages\\%s\\coreplugins"%plugin_subdir, [
            os.path.join(plugin_dir, 'coreplugins', p)
            for p in os.listdir(os.path.join(plugin_dir, 'coreplugins'))
            if p.endswith(".dll")
        ]),

        ("Lib\\site-packages\\%s\\coreplugins"%plugin_subdir, [
            os.path.join(plugin_dir, 'plugins', p)
            for p in os.listdir(os.path.join(plugin_dir, 'plugins'))
            if p.endswith(".dll") or p.endswith(".keep")
        ])
    ]
)<commit_msg>Install plugins/.keep to the correct directory<commit_after>CURRENT_RELEASE = "43"

# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from platform import architecture
from codecs import open

import os
from os import listdir, path

try:
    from wheel.bdist_wheel import bdist_wheel as _bdist_wheel
    class bdist_wheel(_bdist_wheel):
        def finalize_options(self):
            _bdist_wheel.finalize_options(self)
            self.root_is_pure = False

        def get_tag(self):
            python, abi, plat = _bdist_wheel.get_tag(self)
            # We don't contain any python source
            python, abi = 'py2.py3', 'none'
            return python, abi, plat
except ImportError:
    bdist_wheel = None


is_win = (architecture()[1] == "WindowsPE")
is_64 = (architecture()[0] == "64bit")
here = path.abspath(path.dirname(__file__))

if not is_win:
    raise OSError("VapourSynth Portable is currently only supported on Windows Systems.")

if not os.path.exists(os.path.join(here, "VapourSynth.dll")):
    if is_64:
        subdir = "buildp64"
    else:
        subdir = "buildp32"
    build_dir = os.path.join(here, subdir)

    if not os.path.exists(os.path.join(build_dir, "VapourSynth.dll")):
        raise OSError("Failed to detect VapourSynth-portable build directory.")
else:
    subdir = "."
    build_dir = here

if is_64:
    plugin_subdir = 'vapoursynth64'
else:
    plugin_subdir = 'vapoursynth32'
plugin_dir = os.path.join(subdir, plugin_subdir)

setup(
    name = "VapourSynth-portable",
    version=CURRENT_RELEASE,
    description = "A frameserver for the 21st century",
    url = "http://www.vapoursynth.com/",
    download_url = "https://github.com/vapoursynth/vapoursynth",
    author = "<NAME>",
    author_email = "<EMAIL>",

    cmdclass={'bdist_wheel': bdist_wheel},

    packages=[],
    install_requires=["vapoursynth==" + CURRENT_RELEASE],
    setup_requires=["vapoursynth==" + CURRENT_RELEASE],
    data_files = [
        ("Lib\\site-packages", [
            os.path.join(build_dir, p)
            for p in os.listdir(build_dir)
            if p.endswith("140.dll") or \
               p.endswith(".vs")
        ]),

        ("Scripts", [
            os.path.join(build_dir, "VSPipe.exe"),
            os.path.join(build_dir, "VSScript.dll"),
            os.path.join(build_dir, "portable.vs")
        ]),

        ("Lib\\site-packages\\%s\\coreplugins"%plugin_subdir, [
            os.path.join(plugin_dir, 'coreplugins', p)
            for p in os.listdir(os.path.join(plugin_dir, 'coreplugins'))
            if p.endswith(".dll")
        ]),

        ("Lib\\site-packages\\%s\\plugins"%plugin_subdir, [
            os.path.join(plugin_dir, 'plugins', p)
            for p in os.listdir(os.path.join(plugin_dir, 'plugins'))
            if p.endswith(".dll") or p.endswith(".keep")
        ])
    ]
)
{'fraction_non_alphanumeric': 0.13161110141385932, 'fraction_numerical': 0.009425728748472683, 'mean_word_length': 2.6920103092783507, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7013678', 'n_tokens_mistral': 2027, 'n_tokens_neox': 1917, 'n_words': 393}