Preliminary main mbed library for nexpaq development

Committer:
nexpaq
Date:
Fri Nov 04 20:54:50 2016 +0000
Revision:
1:d96dbedaebdb
Parent:
0:6c56fb4bc5f0
Removed extra directories for other platforms

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nexpaq 0:6c56fb4bc5f0 1 """
nexpaq 0:6c56fb4bc5f0 2 This module defines the attributes of the
nexpaq 0:6c56fb4bc5f0 3 PyPI package for the Mbed SDK
nexpaq 0:6c56fb4bc5f0 4 """
nexpaq 0:6c56fb4bc5f0 5
nexpaq 0:6c56fb4bc5f0 6 from shutil import copyfileobj
nexpaq 0:6c56fb4bc5f0 7 from os.path import isfile, join
nexpaq 0:6c56fb4bc5f0 8 from tempfile import TemporaryFile
nexpaq 0:6c56fb4bc5f0 9 from setuptools import find_packages
nexpaq 0:6c56fb4bc5f0 10 from distutils.core import setup
nexpaq 0:6c56fb4bc5f0 11
nexpaq 0:6c56fb4bc5f0 12 LICENSE = open('LICENSE').read()
nexpaq 0:6c56fb4bc5f0 13 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).
nexpaq 0:6c56fb4bc5f0 14
nexpaq 0:6c56fb4bc5f0 15 .. _mbed framework: http://mbed.org"""
nexpaq 0:6c56fb4bc5f0 16 OWNER_NAMES = 'emilmont, bogdanm'
nexpaq 0:6c56fb4bc5f0 17 OWNER_EMAILS = 'Emilio.Monti@arm.com, Bogdan.Marinescu@arm.com'
nexpaq 0:6c56fb4bc5f0 18
nexpaq 0:6c56fb4bc5f0 19 # If mbed_settings.py exists in tools, read it in a temporary file
nexpaq 0:6c56fb4bc5f0 20 # so it can be restored later
nexpaq 0:6c56fb4bc5f0 21 mbed_settings = join('mbed_settings.py')
nexpaq 0:6c56fb4bc5f0 22 backup = None
nexpaq 0:6c56fb4bc5f0 23 if isfile(mbed_settings):
nexpaq 0:6c56fb4bc5f0 24 backup = TemporaryFile()
nexpaq 0:6c56fb4bc5f0 25 with open(mbed_settings, "rb") as f:
nexpaq 0:6c56fb4bc5f0 26 copyfileobj(f, backup)
nexpaq 0:6c56fb4bc5f0 27
nexpaq 0:6c56fb4bc5f0 28 # Create the correct mbed_settings.py for the distribution
nexpaq 0:6c56fb4bc5f0 29 with open(mbed_settings, "wt") as f:
nexpaq 0:6c56fb4bc5f0 30 f.write("from mbed_settings import *\n")
nexpaq 0:6c56fb4bc5f0 31
nexpaq 0:6c56fb4bc5f0 32 setup(name='mbed-tools',
nexpaq 0:6c56fb4bc5f0 33 version='0.1.14',
nexpaq 0:6c56fb4bc5f0 34 description='Build and test system for mbed',
nexpaq 0:6c56fb4bc5f0 35 long_description=DESCRIPTION,
nexpaq 0:6c56fb4bc5f0 36 author=OWNER_NAMES,
nexpaq 0:6c56fb4bc5f0 37 author_email=OWNER_EMAILS,
nexpaq 0:6c56fb4bc5f0 38 maintainer=OWNER_NAMES,
nexpaq 0:6c56fb4bc5f0 39 maintainer_email=OWNER_EMAILS,
nexpaq 0:6c56fb4bc5f0 40 url='https://github.com/mbedmicro/mbed',
nexpaq 0:6c56fb4bc5f0 41 packages=find_packages(),
nexpaq 0:6c56fb4bc5f0 42 license=LICENSE,
nexpaq 0:6c56fb4bc5f0 43 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", "project-generator-definitions>=0.2.26,<0.3.0", "junit-xml", "requests", "pyYAML"])
nexpaq 0:6c56fb4bc5f0 44
nexpaq 0:6c56fb4bc5f0 45 # Restore previous mbed_settings if needed
nexpaq 0:6c56fb4bc5f0 46 if backup:
nexpaq 0:6c56fb4bc5f0 47 backup.seek(0)
nexpaq 0:6c56fb4bc5f0 48 with open(mbed_settings, "wb") as f:
nexpaq 0:6c56fb4bc5f0 49 copyfileobj(backup, f)