Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python312 #290

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/mbed-greentea/mbed_greentea/mbed_greentea_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import sys
import random
import optparse
import imp
import importlib
import io
from time import time
try:
Expand Down Expand Up @@ -187,7 +187,7 @@ def main():

# Show --fm option only if "fm_agent" module installed
try:
imp.find_module('fm_agent')
importlib.util.find_spec('fm_agent')
except ImportError:
fm_help=optparse.SUPPRESS_HELP
else:
Expand Down
6 changes: 4 additions & 2 deletions packages/mbed-greentea/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
mbed-os-tools>=0.0.9
mbed-host-tests>=1.5.0,<2
mbed-os-tools>=0.0.9; python_version <= '3.7'
mbed-os-tools; python_version > '3.7'
mbed-host-tests>=1.5.0,<2; python_version <= '3.7'
mbed-host-tests; python_version > '3.7'
3 changes: 1 addition & 2 deletions packages/mbed-greentea/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

import os
from io import open
from distutils.core import setup
from setuptools import find_packages
from setuptools import find_packages, setup

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'
Expand Down
3 changes: 2 additions & 1 deletion packages/mbed-greentea/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mock>=2
mock>=2; python_version <= '3.7'
mock; python_version > '3.7'
coverage
coveralls
3 changes: 2 additions & 1 deletion packages/mbed-host-tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mbed-os-tools>=0.0.9
mbed-os-tools>=0.0.9; python_version <= '3.7'
mbed-os-tools; python_version > '3.7'
3 changes: 1 addition & 2 deletions packages/mbed-host-tests/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
"""

import os
from distutils.core import setup
from io import open
from setuptools import find_packages
from setuptools import find_packages, setup

DESCRIPTION = "mbed tools used to flash, reset and supervise test execution for mbed-enabled devices"
OWNER_NAMES = 'Qinghao Shi'
Expand Down
6 changes: 3 additions & 3 deletions packages/mbed-host-tests/test/conn_primitive_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def setUp(self):
def test_constructor(self):
self.importer.assert_called_once_with("RemoteModuleMock")

self.remote.client.get_resources.called_once()
self.remote.client.get_resources.assert_called_once()
self.assertEqual(self.remote.remote_module, RemoteModuleMock)
self.assertIsInstance(self.remote.client, RemoteModuleMock)
self.assertIsInstance(self.remote.selected_resource, RemoteResourceMock)
Expand All @@ -93,10 +93,10 @@ def test_constructor(self):
'tags': {"a": True, "b": True}})

# flash is called
self.remote.selected_resource.open_connection.called_once_with("test.bin")
# self.remote.selected_resource.open_connection.called_once_with("test.bin")

# open_connection is called
self.remote.selected_resource.open_connection.called_once()
self.remote.selected_resource.open_connection.assert_called_once()
connect = self.remote.selected_resource.open_connection.call_args[1]
self.assertEqual(connect["parameters"].baudrate, 9600)

Expand Down
3 changes: 2 additions & 1 deletion packages/mbed-host-tests/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mock>=2
mock>=2; python_version <= '3.7'
mock; python_version > '3.7'
coverage
coveralls
6 changes: 4 additions & 2 deletions packages/mbed-ls/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
PrettyTable<=1.0.1; python_version < '3.6'
prettytable>=2.0,<3.0; python_version >= '3.6'
mbed-os-tools>=0.0.9
prettytable>=2.0,<3.0; python_version == '3.7'
prettytable; python_version > '3.7'
mbed-os-tools>=0.0.9; python_version <= '3.7'
mbed-os-tools; python_version > '3.7'
3 changes: 1 addition & 2 deletions packages/mbed-ls/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
"""

import os
from distutils.core import setup
from io import open
from setuptools import find_packages
from setuptools import find_packages, setup

DESCRIPTION = "mbed-ls is a Python module that detects and lists mbed-enabled devices connected to the host computer"
OWNER_NAMES = 'Graham Hammond, Mark Edgeworth'
Expand Down
6 changes: 4 additions & 2 deletions packages/mbed-ls/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
mock>=2
pytest>=3
mock>=2; python_version <= '3.7'
mock; python_version > '3.7'
pytest>=3; python_version <= '3.7'
pytest; python_version > '3.7'
coverage
coveralls
32 changes: 22 additions & 10 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
PySerial>=3.0,<4.0
requests>=2.0,<3.0
intelhex>=2.0,<3.0
PySerial>=3.0,<4.0; python_version <= '3.7'
PySerial; python_version > '3.7'
requests>=2.0,<3.0; python_version <= '3.7'
requests; python_version > '3.7'
intelhex>=2.0,<3.0; python_version <= '3.7'
intelhex; python_version > '3.7'
future
PrettyTable<=1.0.1; python_version < '3.6'
prettytable>=2.0,<3.0; python_version >= '3.6'
PrettyTable<=1.0.1; python_version <= '3.6'
prettytable>=2.0,<3.0; python_version == '3.7'
prettytable; python_version > '3.7'
fasteners
appdirs>=1.4,<2.0
junit-xml>=1.0,<2.0
appdirs>=1.4,<2.0; python_version <= '3.7'
appdirs; python_version > '3.7'
junit-xml>=1.0,<2.0; python_version <= '3.7'
junit-xml; python_version > '3.7'
lockfile
six>=1.0,<2.0
colorama>=0.3,<0.5
six>=1.0,<2.0; python_version <= '3.7'
six; python_version > '3.7'
colorama>=0.3,<0.5; python_version <= '3.7'
colorama; python_version > '3.7'
# When using beautiful soup, the XML parser needs to be installed independently. It is only needed on macOs though.
beautifulsoup4
beautifulsoup4<4.13.0; python_version <= '3.6' #__future__ added
beautifulsoup4; python_version >= '3.7'
soupsieve<2.4; python_version <= '3.7' #__future__ added
soupsieve; python_version > '3.7'
lxml; sys_platform == 'darwin'
setuptools; python_version >= '3.12'
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

import os
import sys
from distutils.core import setup
from setuptools import find_packages
from setuptools import find_packages, setup

DESCRIPTION = "The tools to build, test, and work with Mbed OS"
OWNER_NAMES = "Jimmy Brisson, Brian Daniels"
Expand Down
4 changes: 2 additions & 2 deletions src/mbed_os_tools/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

"""

import imp
import importlib
import sys
from optparse import OptionParser
from optparse import SUPPRESS_HELP
Expand Down Expand Up @@ -245,7 +245,7 @@ def init_host_test_cli_params():

# Show --fm option only if "fm_agent" module installed
try:
imp.find_module("fm_agent")
importlib.util.find_spec("fm_agent")
except ImportError:
fm_help = SUPPRESS_HELP
else:
Expand Down
6 changes: 3 additions & 3 deletions test/test/conn_primitive_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def setUp(self):
def test_constructor(self):
self.importer.assert_called_once_with("RemoteModuleMock")

self.remote.client.get_resources.called_once()
self.remote.client.get_resources.assert_called_once()
self.assertEqual(self.remote.remote_module, RemoteModuleMock)
self.assertIsInstance(self.remote.client, RemoteModuleMock)
self.assertIsInstance(self.remote.selected_resource, RemoteResourceMock)
Expand All @@ -91,10 +91,10 @@ def test_constructor(self):
'tags': {"a": True, "b": True}})

# flash is called
self.remote.selected_resource.open_connection.called_once_with("test.bin")
## self.remote.selected_resource.open_connection.called_once_with("test.bin")

# open_connection is called
self.remote.selected_resource.open_connection.called_once()
self.remote.selected_resource.open_connection.assert_called_once()
connect = self.remote.selected_resource.open_connection.call_args[1]
self.assertEqual(connect["parameters"].baudrate, 9600)

Expand Down
18 changes: 12 additions & 6 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
coverage>=4,<5
coveralls>=1,<2
mock>=2,<4
pytest>=3,<5
wheel>=0.34
setuptools-scm>=4.1
coverage>=4,<5; python_version <= '3.7'
coverage; python_version > '3.7'
coveralls>=1,<2; python_version <= '3.7'
coveralls; python_version > '3.7'
mock>=2,<4; python_version <= '3.7'
mock; python_version > '3.7'
pytest>=3,<5; python_version <= '3.7'
pytest; python_version > '3.7'
wheel>=0.34; python_version <= '3.7'
wheel; python_version > '3.7'
setuptools-scm>=4.1; python_version <= '3.7'
setuptools-scm; python_version > '3.7'