<commit_before>#!/usr/bin/env python

""" run py.test with the --apigen option and rsync the results to a host

    rsyncs the whole package (with all the ReST docs converted to HTML) as well
    as the apigen docs to a given remote host and path
"""

import py
import sys

def rsync(pkgpath, apidocspath, gateway, remotepath):
    """ copy the code and docs to the remote host """
    # copy to a temp dir first, even though both paths (normally) share the
    # same parent dir, that may contain other stuff that we don't want to
    # copy...
    tempdir = py.test.ensuretemp('update_website_rsync_temp')
    pkgpath.copy(tempdir.ensure(pkgpath.basename, dir=True))
    apidocspath.copy(tempdir.ensure(apidocspath.basename, dir=True))

    rs = py.execnet.RSync(tempdir)
    rs.add_target(gateway, remotepath, delete=True)
    rs.send()

def run_tests(pkgpath, args='', captureouterr=False):
    """ run the unit tests and build the docs """
    pypath = py.__package__.getpath()
    pytestpath = pypath.join('bin/py.test')
    # XXX this would need a Windows specific version if we want to allow
    # running this script on that platform, but currently --apigen doesn't
    # work there anyway...<commit_msg>[svn r38649] Adding _findpy call to not have to set PYTHONPATH to find the py lib.<commit_after>#!/usr/bin/env python

""" run py.test with the --apigen option and rsync the results to a host

    rsyncs the whole package (with all the ReST docs converted to HTML) as well
    as the apigen docs to a given remote host and path
"""
from _findpy import py
import py
import sys

def rsync(pkgpath, apidocspath, gateway, remotepath):
    """ copy the code and docs to the remote host """
    # copy to a temp dir first, even though both paths (normally) share the
    # same parent dir, that may contain other stuff that we don't want to
    # copy...
    tempdir = py.test.ensuretemp('update_website_rsync_temp')
    pkgpath.copy(tempdir.ensure(pkgpath.basename, dir=True))
    apidocspath.copy(tempdir.ensure(apidocspath.basename, dir=True))

    rs = py.execnet.RSync(tempdir)
    rs.add_target(gateway, remotepath, delete=True)
    rs.send()

def run_tests(pkgpath, args='', captureouterr=False):
    """ run the unit tests and build the docs """
    pypath = py.__package__.getpath()
    pytestpath = pypath.join('bin/py.test')
    # XXX this would need a Windows specific version if we want to allow
    # running this script on that platform, but currently --apigen doesn't
    # work there anyway...
{'fraction_non_alphanumeric': 0.09574890742947954, 'fraction_numerical': 0.001986491855383393, 'mean_word_length': 3.6117216117216118, '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': '2328201', 'n_tokens_mistral': 803, 'n_tokens_neox': 771, 'n_words': 296}