diff --git a/MANIFEST.in b/MANIFEST.in index c5e80104c6..f985a1a4e1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,7 @@ +global-exclude *.py[cod] __pycache__ *.so +graft test include README.md +include LICENSE +include CONTRIBUTING.md +include requirements.txt include test_requirements.txt diff --git a/packages/mbed-greentea/MANIFEST.in b/packages/mbed-greentea/MANIFEST.in index 8d035b7ee0..4959a6d9b8 100644 --- a/packages/mbed-greentea/MANIFEST.in +++ b/packages/mbed-greentea/MANIFEST.in @@ -1,2 +1,8 @@ -include README.md LICENSE CONTRIBUTING.md +global-exclude *.py[cod] __pycache__ *.so +graft test +include README.md +include LICENSE +include CONTRIBUTING.md +include requirements.txt +include test_requirements.txt include .coveragerc diff --git a/packages/mbed-greentea/requirements.txt b/packages/mbed-greentea/requirements.txt new file mode 100644 index 0000000000..9d02d2be9f --- /dev/null +++ b/packages/mbed-greentea/requirements.txt @@ -0,0 +1,2 @@ +mbed-os-tools>=0.0.9,<0.1.0 +mbed-host-tests>=1.5.0,<2 diff --git a/packages/mbed-greentea/setup.py b/packages/mbed-greentea/setup.py index a88b2baaf0..5f7ee2e6da 100644 --- a/packages/mbed-greentea/setup.py +++ b/packages/mbed-greentea/setup.py @@ -27,21 +27,31 @@ from distutils.core import setup from setuptools import find_packages - DESCRIPTION = "mbed 3.0 onwards test suite, codename Greentea. The test suite is a collection of tools that enable automated testing on mbed-enabled platforms" OWNER_NAMES = 'Anna Bridge, Qinghao Shi' OWNER_EMAILS = 'Anna.Bridge@arm.com, qinghao.shi@arm.com' +repository_dir = os.path.dirname(__file__) + def read(fname): """ Utility function to cat in a file (used for the README) - @param fname: the name of the file to read, relative to the directory containing this file + @param fname: the name of the file to read, + relative to the directory containing this file @return: The string content of the opened file """ - return open(os.path.join(os.path.dirname(__file__), fname), encoding="utf-8").read() + with open(os.path.join(repository_dir, fname), mode='r') as f: + return f.read() + + +with open(os.path.join(repository_dir, 'requirements.txt')) as fh: + requirements = fh.readlines() +with open(os.path.join(repository_dir, 'test_requirements.txt')) as fh: + test_requirements = fh.readlines() +python_requires = '>=2.7.10, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4' setup(name='mbed-greentea', version='1.7.3', description=DESCRIPTION, @@ -56,13 +66,24 @@ def read(fname): license="Apache-2.0", test_suite='test', entry_points={ - "console_scripts": ["mbedgt=mbed_greentea.mbed_greentea_cli:main",], + "console_scripts": ["mbedgt=mbed_greentea.mbed_greentea_cli:main", ], }, - install_requires=[ - "mbed-os-tools>=0.0.9,<0.1.0", - "mbed-host-tests>=1.5.0,<2" - ], - tests_require=[ - "mock>=2" - ] -) + classifiers=( + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python', + 'Topic :: Software Development :: Build Tools', + 'Topic :: Software Development :: Embedded Systems', + 'Topic :: Software Development :: Testing', + ), + python_requires=python_requires, + install_requires=requirements, + tests_require=test_requirements + ) diff --git a/packages/mbed-greentea/test_requirements.txt b/packages/mbed-greentea/test_requirements.txt index 9d64331330..429709a2d2 100644 --- a/packages/mbed-greentea/test_requirements.txt +++ b/packages/mbed-greentea/test_requirements.txt @@ -1,2 +1,3 @@ +mock>=2 coverage coveralls diff --git a/packages/mbed-host-tests/MANIFEST.in b/packages/mbed-host-tests/MANIFEST.in index 66f99f7031..e95a6c2a7d 100644 --- a/packages/mbed-host-tests/MANIFEST.in +++ b/packages/mbed-host-tests/MANIFEST.in @@ -1,2 +1,7 @@ +global-exclude *.py[cod] __pycache__ *.so +graft test include README.md +include requirements.txt +include test_requirements.txt include .coveragerc + diff --git a/packages/mbed-host-tests/requirements.txt b/packages/mbed-host-tests/requirements.txt new file mode 100644 index 0000000000..73e4a80573 --- /dev/null +++ b/packages/mbed-host-tests/requirements.txt @@ -0,0 +1 @@ +mbed-os-tools>=0.0.9,<0.1.0 diff --git a/packages/mbed-host-tests/setup.py b/packages/mbed-host-tests/setup.py index 2af22e931b..5b0522c0e5 100644 --- a/packages/mbed-host-tests/setup.py +++ b/packages/mbed-host-tests/setup.py @@ -31,16 +31,27 @@ OWNER_NAMES = 'Qinghao Shi' OWNER_EMAILS = 'qinghao.shi@arm.com' +repository_dir = os.path.dirname(__file__) + def read(fname): """ Utility function to cat in a file (used for the README) - @param fname: the name of the file to read, relative to the directory containing this file + @param fname: the name of the file to read, + relative to the directory containing this file @return: The string content of the opened file """ - return open(os.path.join(os.path.dirname(__file__), fname), encoding="utf8").read() + with open(os.path.join(repository_dir, fname), mode='r') as f: + return f.read() + + +with open(os.path.join(repository_dir, 'requirements.txt')) as fh: + requirements = fh.readlines() +with open(os.path.join(repository_dir, 'test_requirements.txt')) as fh: + test_requirements = fh.readlines() +python_requires = '>=2.7.10, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4' setup(name='mbed-host-tests', version='1.5.9', description=DESCRIPTION, @@ -55,14 +66,26 @@ def read(fname): license="Apache-2.0", test_suite='test', entry_points={ - "console_scripts": - ["mbedhtrun=mbed_host_tests.mbedhtrun:main", - "mbedflsh=mbed_host_tests.mbedflsh:main"], + "console_scripts": + ["mbedhtrun=mbed_host_tests.mbedhtrun:main", + "mbedflsh=mbed_host_tests.mbedflsh:main"], }, - install_requires=[ - "mbed-os-tools>=0.0.9,<0.1.0" - ], - tests_require=[ - "mock>=2" - ] + classifiers=( + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python', + 'Topic :: Software Development :: Build Tools', + 'Topic :: Software Development :: Embedded Systems', + 'Topic :: Software Development :: Testing', + ), + python_requires=python_requires, + install_requires=requirements, + tests_require=test_requirements ) diff --git a/packages/mbed-host-tests/test_requirements.txt b/packages/mbed-host-tests/test_requirements.txt index 9d64331330..429709a2d2 100644 --- a/packages/mbed-host-tests/test_requirements.txt +++ b/packages/mbed-host-tests/test_requirements.txt @@ -1,2 +1,3 @@ +mock>=2 coverage coveralls diff --git a/packages/mbed-ls/MANIFEST.in b/packages/mbed-ls/MANIFEST.in index 8d035b7ee0..46d7e4bc8b 100644 --- a/packages/mbed-ls/MANIFEST.in +++ b/packages/mbed-ls/MANIFEST.in @@ -1,2 +1,6 @@ -include README.md LICENSE CONTRIBUTING.md +global-exclude *.py[cod] __pycache__ *.so +graft test +include README.md +include requirements.txt +include test_requirements.txt include .coveragerc diff --git a/packages/mbed-ls/requirements.txt b/packages/mbed-ls/requirements.txt new file mode 100644 index 0000000000..13c3bf4d30 --- /dev/null +++ b/packages/mbed-ls/requirements.txt @@ -0,0 +1,2 @@ +PrettyTable>=0.7.2 +mbed-os-tools>=0.0.9,<0.1.0 \ No newline at end of file diff --git a/packages/mbed-ls/setup.py b/packages/mbed-ls/setup.py index b04eadfa04..60c7cf33c7 100644 --- a/packages/mbed-ls/setup.py +++ b/packages/mbed-ls/setup.py @@ -28,16 +28,27 @@ OWNER_NAMES = 'Graham Hammond, Mark Edgeworth' OWNER_EMAILS = 'Graham.Hammond@arm.com, Mark.Edgeworth@arm.com' +repository_dir = os.path.dirname(__file__) + def read(fname): """ Utility function to cat in a file (used for the README) - @param fname: the name of the file to read, relative to the directory containing this file + @param fname: the name of the file to read, + relative to the directory containing this file @return: The string content of the opened file """ - return open(os.path.join(os.path.dirname(__file__), fname), encoding="utf8").read() + with open(os.path.join(repository_dir, fname), mode='r') as f: + return f.read() + + +with open(os.path.join(repository_dir, 'requirements.txt')) as fh: + requirements = fh.readlines() +with open(os.path.join(repository_dir, 'test_requirements.txt')) as fh: + test_requirements = fh.readlines() +python_requires = '>=2.7.10, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4' setup(name='mbed-ls', version='1.7.9', description=DESCRIPTION, @@ -51,19 +62,28 @@ def read(fname): packages=find_packages(), license="Apache-2.0", test_suite='test', + classifiers=( + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python', + 'Topic :: Software Development :: Build Tools', + 'Topic :: Software Development :: Embedded Systems', + ), + python_requires=python_requires, entry_points={ - "console_scripts": [ - "mbedls=mbed_lstools:mbedls_main", - ], + "console_scripts": [ + "mbedls=mbed_lstools:mbedls_main", + ], }, - install_requires=[ - "PrettyTable>=0.7.2", - "mbed-os-tools>=0.0.9,<0.1.0" - ], - tests_require=[ - "mock>=2", - "pytest>=3" - ], + install_requires=requirements, + tests_require=test_requirements, extras_require={ "colorized_logs": ["colorlog"] } diff --git a/packages/mbed-ls/test_requirements.txt b/packages/mbed-ls/test_requirements.txt index 9d64331330..c02522629e 100644 --- a/packages/mbed-ls/test_requirements.txt +++ b/packages/mbed-ls/test_requirements.txt @@ -1,2 +1,4 @@ +mock>=2 +pytest>=3 coverage coveralls diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000..0ccdc16dea --- /dev/null +++ b/requirements.txt @@ -0,0 +1,11 @@ +PySerial>=3.0,<4.0 +requests>=2.0,<3.0 +intelhex>=2.0,<3.0 +future +PrettyTable>=0.7.2 +fasteners +appdirs>=1.4,<2.0 +junit-xml>=1.0,<2.0 +lockfile +six>=1.0,<2.0 +colorama>=0.3,<0.5 diff --git a/setup.py b/setup.py index b150035ba9..6dd02b3b85 100644 --- a/setup.py +++ b/setup.py @@ -21,13 +21,27 @@ OWNER_NAMES = "Jimmy Brisson, Brian Daniels" OWNER_EMAILS = "jimmy.brisson@arm.com, brian.daniels@arm.com" +repository_dir = os.path.dirname(__file__) + -# Utility function to cat in a file (used for the README) def read(fname): - with open(os.path.join(os.path.dirname(__file__), fname), 'r') as f: + """ + Utility function to cat in a file (used for the README) + @param fname: the name of the file to read, + relative to the directory containing this file + @return: The string content of the opened file + """ + with open(os.path.join(repository_dir, fname), mode='r') as f: return f.read() +with open(os.path.join(repository_dir, 'requirements.txt')) as fh: + requirements = fh.readlines() + +with open(os.path.join(repository_dir, 'test_requirements.txt')) as fh: + test_requirements = fh.readlines() + +python_requires = '>=2.7.10, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4' setup( name="mbed-os-tools", version=read("src/mbed_os_tools/VERSION.txt").strip(), @@ -44,20 +58,23 @@ def read(fname): package_data={"": ["VERSION.txt"]}, license="Apache-2.0", test_suite="test", - install_requires=[ - "PySerial>=3.0,<4.0", - "requests>=2.0,<3.0", - "intelhex>=2.0,<3.0", - "future", - "PrettyTable>=0.7.2", - "fasteners", - "appdirs>=1.4,<2.0", - "junit-xml>=1.0,<2.0", - "lockfile", - "six>=1.0,<2.0", - "colorama>=0.3,<0.5", - ], - tests_require=read("test_requirements.txt").splitlines(), + classifiers=( + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python', + 'Topic :: Software Development :: Build Tools', + 'Topic :: Software Development :: Embedded Systems', + ), + python_requires=python_requires, + install_requires=requirements, + tests_require=test_requirements, extras_require={ "pyocd": ["pyocd==0.14.0"] },