2013-10-18 10:23:34 +00:00
"""
This module defines the attributes of the
PyPI package for the Mbed SDK
"""
2015-02-10 22:41:39 +00:00
from shutil import copyfileobj
2013-12-18 14:03:27 +00:00
from os . path import isfile , join
from tempfile import TemporaryFile
2015-02-10 22:41:39 +00:00
from setuptools import find_packages
from distutils . core import setup
2013-10-18 10:10:22 +00:00
2013-10-18 10:23:34 +00:00
LICENSE = open ( ' LICENSE ' ) . read ( )
2013-10-22 11:13:04 +00:00
DESCRIPTION = """ A set of Python scripts that can be used to compile programs written on top of the `mbed framework`_. It can also be used to export mbed projects to other build systems and IDEs (uVision, IAR, makefiles).
. . _mbed framework : http : / / mbed . org """
2013-10-21 10:22:19 +00:00
OWNER_NAMES = ' emilmont, bogdanm '
OWNER_EMAILS = ' Emilio.Monti@arm.com, Bogdan.Marinescu@arm.com '
2013-10-18 10:12:43 +00:00
2013-12-18 14:03:27 +00:00
# If private_settings.py exists in workspace_tools, read it in a temporary file
# so it can be restored later
private_settings = join ( ' workspace_tools ' , ' private_settings.py ' )
backup = None
if isfile ( private_settings ) :
backup = TemporaryFile ( )
with open ( private_settings , " rb " ) as f :
copyfileobj ( f , backup )
# Create the correct private_settings.py for the distribution
with open ( private_settings , " wt " ) as f :
f . write ( " from mbed_settings import * \n " )
2013-10-24 09:17:17 +00:00
setup ( name = ' mbed-tools ' ,
2013-12-18 14:03:27 +00:00
version = ' 0.1.14 ' ,
2013-10-21 09:27:53 +00:00
description = ' Build and test system for mbed ' ,
long_description = DESCRIPTION ,
2013-10-21 10:22:19 +00:00
author = OWNER_NAMES ,
author_email = OWNER_EMAILS ,
maintainer = OWNER_NAMES ,
maintainer_email = OWNER_EMAILS ,
2013-10-18 10:15:28 +00:00
url = ' https://github.com/mbedmicro/mbed ' ,
2013-12-18 14:03:27 +00:00
packages = find_packages ( ) ,
2014-11-13 11:19:30 +00:00
license = LICENSE ,
2015-03-31 16:39:49 +00:00
install_requires = [ " PrettyTable>=0.7.2 " , " PySerial>=2.7 " , " IntelHex>=1.3 " , " colorama>=0.3.3 " , " Jinja2>=2.7.3 " ] )
2013-12-18 14:03:27 +00:00
# Restore previous private_settings if needed
if backup :
backup . seek ( 0 )
with open ( private_settings , " wb " ) as f :
copyfileobj ( backup , f )