Skip to content

Commit

Permalink
Python Egg builder
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Oberstein committed Nov 25, 2013
1 parent 9c50eb5 commit f637dcd
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions taschenmesser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import aws
import fileutil
import svg
import pyegg


def generate(env):
Expand All @@ -35,6 +36,9 @@ def generate(env):
if svg.exists(env):
svg.generate(env)

if pyegg.exists(env):
pyegg.generate(env)


def exists(env):
return True
42 changes: 42 additions & 0 deletions taschenmesser/pyegg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
###############################################################################
##
## Copyright 2013 (C) Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
###############################################################################

__all__ = ['exists', 'generate']


def exists(env):
try:
import setuptools
return True
except:
print "Taschenmesser: Setuptools missing. Python Egg creation won't be available."
return False



def generate(env):
from SCons.Builder import Builder

#import setuptools
#from setuptools import setup
from setuptools.sandbox import run_setup

def python_egg_builder(target, source, env):
run_setup(source[0].path, ["bdist_egg"])

env.Append(BUILDERS = {'Egg': Builder(action = python_egg_builder)})

0 comments on commit f637dcd

Please sign in to comment.