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
2016-06-09 21:24:05 +00:00
# If mbed_settings.py exists in tools, read it in a temporary file
2013-12-18 14:03:27 +00:00
# so it can be restored later
2016-06-09 21:24:05 +00:00
mbed_settings = join ( ' mbed_settings.py ' )
2013-12-18 14:03:27 +00:00
backup = None
2016-06-09 21:24:05 +00:00
if isfile ( mbed_settings ) :
2013-12-18 14:03:27 +00:00
backup = TemporaryFile ( )
2016-06-09 21:24:05 +00:00
with open ( mbed_settings , " rb " ) as f :
2013-12-18 14:03:27 +00:00
copyfileobj ( f , backup )
2016-06-09 21:24:05 +00:00
# Create the correct mbed_settings.py for the distribution
with open ( mbed_settings , " wt " ) as f :
2013-12-18 14:03:27 +00:00
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 ,
2016-06-14 20:39:54 +00:00
install_requires = [ " PrettyTable>=0.7.2 " , " PySerial>=2.7 " , " IntelHex>=1.3 " , " colorama>=0.3.3 " , " Jinja2>=2.7.3 " , " project-generator>=0.9.3,<0.10.0 " , " junit-xml " , " requests " , " pyYAML " ] )
2013-12-18 14:03:27 +00:00
2016-06-09 21:24:05 +00:00
# Restore previous mbed_settings if needed
2013-12-18 14:03:27 +00:00
if backup :
backup . seek ( 0 )
2016-06-09 21:24:05 +00:00
with open ( mbed_settings , " wb " ) as f :
2013-12-18 14:03:27 +00:00
copyfileobj ( backup , f )