<commit_before>#!/usr/bin/env python3
"""
Packaging implementation for PythonTurtle.
"""
from glob import glob
import os
import os.path
import shutil

from setuptools import Command
from setuptools import setup, find_packages

import pythonturtle as package


class SimpleCommand(Command):
    """A simple setuptools command (implementation of abstract base class)"""
    user_options = []

    def initialize_options(self):
        """Abstract method of the base class (required to be overridden)"""

    def finalize_options(self):
        """Abstract method of the base class (required to be overridden)"""


class Bundle(SimpleCommand):
    """Build an application bundle for the current platform"""
    description = __doc__

    @staticmethod
    def run():
        """
        Create an application bundle (using PyInstaller)
        """
        import PyInstaller.__main__  # pylint: disable=import-outside-toplevel

        resources_folder = os.path.join('pythonturtle', 'resources')

        def resource_path(file_glob):
            return os.path.join(resources_folder, file_glob)

        def include_resources(file_glob):
            return '{src}{separator}{dest}'.format(
                src=resource_path(file_glob),
                separator=os.pathsep,
                dest=resources_folder)

        PyInstaller.__main__.run([
            '--name=%s' % package.name,
            '--onefile',
            '--windowed',
            '--add-binary=%s' % include_resources('*.ic*'),
            '--add-binary=%s' % include_resources('*.png'),<commit_msg>Fix "Unknown Mach-O header" error in macOS builds<commit_after>#!/usr/bin/env python3
"""
Packaging implementation for PythonTurtle.
"""
from glob import glob
import os
import os.path
import shutil

from setuptools import Command
from setuptools import setup, find_packages

import pythonturtle as package


class SimpleCommand(Command):
    """A simple setuptools command (implementation of abstract base class)"""
    user_options = []

    def initialize_options(self):
        """Abstract method of the base class (required to be overridden)"""

    def finalize_options(self):
        """Abstract method of the base class (required to be overridden)"""


class Bundle(SimpleCommand):
    """Build an application bundle for the current platform"""
    description = __doc__

    @staticmethod
    def run():
        """
        Create an application bundle (using PyInstaller)
        """
        import PyInstaller.__main__  # pylint: disable=import-outside-toplevel

        resources_folder = os.path.join('pythonturtle', 'resources')

        def resource_path(file_glob):
            return os.path.join(resources_folder, file_glob)

        def include_resources(file_glob):
            return '{src}{separator}{dest}'.format(
                src=resource_path(file_glob),
                separator=os.pathsep,
                dest=resources_folder)

        PyInstaller.__main__.run([
            '--name=%s' % package.name,
            '--onefile',
            '--windowed',
            '--add-data=%s' % include_resources('*.ic*'),
            '--add-data=%s' % include_resources('*.png'),
{'fraction_non_alphanumeric': 0.11128625472887768, 'fraction_numerical': 0.0006305170239596469, 'mean_word_length': 2.790919952210275, 'pattern_counts': {'":': 0, '<': 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': '5839663', 'n_tokens_mistral': 887, 'n_tokens_neox': 838, 'n_words': 234}