Skip to content

Instantly share code, notes, and snippets.

View hithwen's full-sized avatar
🏠
Working from home

Julia hithwen

🏠
Working from home
View GitHub Profile
@hithwen
hithwen / cython-setup.py
Last active August 22, 2016 10:27
Create compiled executable from multimodule python project: The process consists in various steps: 1 - compile your python code and generate a mirror project of .so 2 - Create a a main.py file that import all required third party libraries and your main module and call it 3 - Package it with pyinstaller
import distutils.core
from distutils.extension import Extension
from Cython.Distutils import build_ext # @UnresolvedImport
import os
import shutil
import sys
project_pkg_path = "DESTINATION PATH"
project_python_path = "PATH TO YOUR PYTHON PROJ"
@hithwen
hithwen / master.cfg
Created May 22, 2013 15:52
Post-receive hook to launch buildbot for master, develop and release/* branches This file has to be placed in remote repo hooks folder You could just call git_buildbot.py $1 $2 $3 but then you'll see every commit in buildbot timeline
from buildbot.changes import pb
c['change_source'] = pb.PBChangeSource()
for branch, builder in {'master':'release-builder', 'develop':'develop-builder'}.iteritems():
c['schedulers'].append(SingleBranchScheduler(
name="Continuous-%s" % branch,
branch=branch,
treeStableTimer=1*60,
builderNames=[builder]))
@hithwen
hithwen / buildbot-nose-html.py
Last active December 17, 2015 14:19
Buildbot nosetest and nosecoverage with html reports, only works with slave and master in same machine, otherwhise you'll probably need a FileUpload extra step
import os
from buildbot.steps.shell import ShellCommand
from buildbot.process.properties import WithProperties
import stat
import StringIO
import re
class NoseTest(ShellCommand):
report_path = '/var/www/testreport/%s.html'
@hithwen
hithwen / buildbot-background-server
Created May 21, 2013 21:07
buildbot running a test server and retrieving output after running client tests
class StopServer(ShellCommand):
def _init_(self):
ShellCommand.__init__(self, command=['pkill', '-f', 'my-server-name'],
workdir='build/python',
description='Stopping test server')
def createSummary(self, log):
buildername = self.getProperty("buildername")
f = '/home/buildbot/slave/%s/build/python/nohup.out' % buildername
output = open(f, "r").read()