upload
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. """
  2. This module defines the attributes of the
  3. PyPI package for the Mbed SDK
  4. """
  5. from shutil import copyfileobj
  6. from os.path import isfile, join
  7. from tempfile import TemporaryFile
  8. from setuptools import find_packages
  9. from distutils.core import setup
  10. LICENSE = open('LICENSE').read()
  11. 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).
  12. .. _mbed framework: http://mbed.org"""
  13. OWNER_NAMES = 'emilmont, bogdanm'
  14. OWNER_EMAILS = '[email protected], [email protected]'
  15. # If private_settings.py exists in workspace_tools, read it in a temporary file
  16. # so it can be restored later
  17. private_settings = join('workspace_tools', 'private_settings.py')
  18. backup = None
  19. if isfile(private_settings):
  20. backup = TemporaryFile()
  21. with open(private_settings, "rb") as f:
  22. copyfileobj(f, backup)
  23. # Create the correct private_settings.py for the distribution
  24. with open(private_settings, "wt") as f:
  25. f.write("from mbed_settings import *\n")
  26. setup(name='mbed-tools',
  27. version='0.1.14',
  28. description='Build and test system for mbed',
  29. long_description=DESCRIPTION,
  30. author=OWNER_NAMES,
  31. author_email=OWNER_EMAILS,
  32. maintainer=OWNER_NAMES,
  33. maintainer_email=OWNER_EMAILS,
  34. url='https://github.com/mbedmicro/mbed',
  35. packages=find_packages(),
  36. license=LICENSE,
  37. install_requires=["PrettyTable>=0.7.2", "PySerial>=2.7", "IntelHex>=1.3", "colorama>=0.3.3", "Jinja2>=2.7.3"])
  38. # Restore previous private_settings if needed
  39. if backup:
  40. backup.seek(0)
  41. with open(private_settings, "wb") as f:
  42. copyfileobj(backup, f)