<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from distutils.core import setup
from distutils.spawn import find_executable
import distutils.command.build

import subprocess
import shutil
import shlex
import os.path

from os.path import join
import glob


class build(distutils.command.build.build):
    def run(self):
        result = distutils.command.build.build.run(self)
        cwd = os.path.dirname(os.path.abspath(__file__))
        new_module_dir = join(cwd, 'build', 'lib', 'phantompy')

        self._compile_phantompy(cwd)

        for filename in glob.glob(os.path.join(cwd, 'build', '_phantompy*')):
            if os.path.isfile(filename) and not os.path.islink(filename):
                shutil.copy(filename, os.path.join(new_module_dir, '_phantompy.so'))

        return result

    def _compile_phantompy(self, cwd):
        retval = subprocess.call(shlex.split('cmake ..'),
                                 cwd=os.path.join(cwd, 'build'))
        if retval:
            raise Exception("CMake Error!")

        retval = subprocess.call(shlex.split('make'),
                                 cwd=os.path.join(cwd, 'build'))

        if retval:
            raise Exception("CMake Error!")


setup(
    name = 'phantompy',
    version = "0.7",
    description = "Headless WebKit engine for python build on top of Qt5 and Webkit",
    long_description = "",
    keywords = 'webkit, headless, qt, engine',
    author = '<NAME>',
    author_email = '<EMAIL>',
    url = 'https://github.com/niwibe/phantompy',
    license = 'BSD',
    zip_safe = False,
    packages = [
        "phantompy",
    ],
    cmdclass={
        'build': build,
    },
    classifiers = [
        'Development Status :: 4 - Beta',<commit_msg>Increment version to 0.8<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from distutils.core import setup
from distutils.spawn import find_executable
import distutils.command.build

import subprocess
import shutil
import shlex
import os.path

from os.path import join
import glob


class build(distutils.command.build.build):
    def run(self):
        result = distutils.command.build.build.run(self)
        cwd = os.path.dirname(os.path.abspath(__file__))
        new_module_dir = join(cwd, 'build', 'lib', 'phantompy')

        self._compile_phantompy(cwd)

        for filename in glob.glob(os.path.join(cwd, 'build', '_phantompy*')):
            if os.path.isfile(filename) and not os.path.islink(filename):
                shutil.copy(filename, os.path.join(new_module_dir, '_phantompy.so'))

        return result

    def _compile_phantompy(self, cwd):
        retval = subprocess.call(shlex.split('cmake ..'),
                                 cwd=os.path.join(cwd, 'build'))
        if retval:
            raise Exception("CMake Error!")

        retval = subprocess.call(shlex.split('make'),
                                 cwd=os.path.join(cwd, 'build'))

        if retval:
            raise Exception("CMake Error!")


setup(
    name = 'phantompy',
    version = "0.8",
    description = "Headless WebKit engine for python build on top of Qt5 and Webkit",
    long_description = "",
    keywords = 'webkit, headless, qt, engine',
    author = '<NAME>',
    author_email = '<EMAIL>',
    url = 'https://github.com/niwibe/phantompy',
    license = 'BSD',
    zip_safe = False,
    packages = [
        "phantompy",
    ],
    cmdclass={
        'build': build,
    },
    classifiers = [
        'Development Status :: 4 - Beta',
{'fraction_non_alphanumeric': 0.13118033723921121, 'fraction_numerical': 0.003429551300371535, 'mean_word_length': 2.434739941118744, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4748524', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1080, 'n_words': 248}