optionsinstall=python_setup
apycot statusfailure
branchdefault
keep_archiveno
for environmentdatabase env

recipe information

# an apycot recipe that run unit tests for python projects
import os
from os.path import join
import sys
import hglib

from checkers.apycot import python # trigger registration
from apycotlib import Command, narvalactions as na


with na.apycot_environment(plan) as test:
    os.environ.pop('NO_SETUPTOOLS') # ensure we do not have this env var for venv setup
    Command(test.writer, ['virtualenv', test.tmpdir], raises=True).run()
    # Command(test.writer, ['virtualenv', '--system-site-packages', test.tmpdir], raises=True).run()
    os.environ['PATH'] = ':'.join([join(test.tmpdir, 'bin'), os.environ['PATH']])
    os.environ['VIRTUAL_ENV'] = test.tmpdir
    egg_cache_dir = join(test.tmpdir, 'tmp')
    os.environ['PYTHON_EGG_CACHE'] = egg_cache_dir
    if not os.path.exists(egg_cache_dir):
        os.makedirs(egg_cache_dir)
    os.environ['HGRCPATH'] = os.devnull

    configs = [('ui.username', 'narval'),
               ('phases.publish', 'False'),
              ]
    repo = test.environment['repository']
    dst_dir = join(test.tmpdir, 'src', str(repo['eid']))
    source_url = repo['source_url']
    rev = test.texec['branch']
    if not os.path.exists(dst_dir):
        os.makedirs(dst_dir)
    hglib.clone(source_url, dst_dir, updaterev=rev)

    # link the current test execution with the revision 
    cset = hglib.open(dst_dir).parents()[0].node[:12]
    test.writer.raw(source_url, cset, 'revision')

    os.chdir(dst_dir)
    # setup
    cmdargs = ['python', 'setup.py', 'install']
    Command(test.writer, cmdargs, raises=True, cwd=dst_dir).run()

    if os.path.exists('requirements-test.txt'):
        cmdargs = ['pip', 'install',  '-r', 'requirements-test.txt']
        Command(test.writer, cmdargs, raises=True, cwd=dst_dir).run()

    # the (at last) run test unit tests
    test.project_path = lambda subpath=None, dst=dst_dir: dst_dir
    checker, status = test.run_checker('pyunit')

version configuration

execution information

typelabelvalue
versionapycot3.4.1
log
severitypath or commandlinemessage
 DEBUG  
Set NO_SETUPTOOLS=u'1'
 DEBUG  
Set DISPLAY=u':1.0'
 DEBUG  
Set LC_ALL=u'fr_FR.UTF-8'
 DEBUGvirtualenv /tmp/tmpMYQ8G1 
`virtualenv /tmp/tmpMYQ8G1` executed successfuly output: New python executable in /tmp/tmpMYQ8G1/bin/python2 Also creating executable in /tmp/tmpMYQ8G1/bin/python Installing setuptools, pip...done. Running virtualenv with interpreter /usr/bin/python2
 DEBUGpython setup.py install 
execution log
severitypath or commandlinemessage
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOengine.py133
fire transition start of https://www.logilab.org/3181352
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 INFOengine.py133
fire transition end of https://www.logilab.org/3181352
 INFOconnectionpool.py697
Starting new HTTPS connection (1): www.logilab.org
 DEBUG  
pyunit [failure]