#2464 - Reverting changes from Python3.12 investigations, updating README and prproject.toml so that python 3.11 is allowed
This commit is contained in:
@@ -14,48 +14,33 @@ parameters:
|
|||||||
- name: matrix
|
- name: matrix
|
||||||
type: object
|
type: object
|
||||||
default:
|
default:
|
||||||
# - job_name: 'UbuntuPython38'
|
- job_name: 'UbuntuPython38'
|
||||||
# py: '3.8'
|
py: '3.8'
|
||||||
# img: 'ubuntu-latest'
|
img: 'ubuntu-latest'
|
||||||
# every_time: false
|
every_time: false
|
||||||
# publish_coverage: false
|
publish_coverage: false
|
||||||
# - job_name: 'UbuntuPython310'
|
- job_name: 'UbuntuPython311'
|
||||||
# py: '3.10'
|
py: '3.11'
|
||||||
# img: 'ubuntu-latest'
|
|
||||||
# every_time: true
|
|
||||||
# publish_coverage: true
|
|
||||||
- job_name: 'UbuntuPython312_TEST'
|
|
||||||
py: '3.12'
|
|
||||||
img: 'ubuntu-latest'
|
img: 'ubuntu-latest'
|
||||||
every_time: true
|
every_time: true
|
||||||
publish_coverage: true
|
publish_coverage: true
|
||||||
# - job_name: 'WindowsPython38'
|
- job_name: 'WindowsPython38'
|
||||||
# py: '3.8'
|
py: '3.8'
|
||||||
# img: 'windows-latest'
|
|
||||||
# every_time: false
|
|
||||||
# publish_coverage: false
|
|
||||||
# - job_name: 'WindowsPython310'
|
|
||||||
# py: '3.10'
|
|
||||||
# img: 'windows-latest'
|
|
||||||
# every_time: false
|
|
||||||
# publish_coverage: false
|
|
||||||
- job_name: 'WindowsPython312_TEST'
|
|
||||||
py: '3.12'
|
|
||||||
img: 'windows-latest'
|
img: 'windows-latest'
|
||||||
every_time: false
|
every_time: false
|
||||||
publish_coverage: false
|
publish_coverage: false
|
||||||
# - job_name: 'MacOSPython38'
|
- job_name: 'WindowsPython311'
|
||||||
# py: '3.8'
|
py: '3.11'
|
||||||
# img: 'macOS-latest'
|
img: 'windows-latest'
|
||||||
# every_time: false
|
every_time: false
|
||||||
# publish_coverage: false
|
publish_coverage: false
|
||||||
# - job_name: 'MacOSPython310'
|
- job_name: 'MacOSPython38'
|
||||||
# py: '3.10'
|
py: '3.8'
|
||||||
# img: 'macOS-latest'
|
img: 'macOS-latest'
|
||||||
# every_time: false
|
every_time: false
|
||||||
# publish_coverage: false
|
publish_coverage: false
|
||||||
- job_name: 'MacOSPython312_TEST'
|
- job_name: 'MacOSPython311'
|
||||||
py: '3.12'
|
py: '3.11'
|
||||||
img: 'macOS-latest'
|
img: 'macOS-latest'
|
||||||
every_time: false
|
every_time: false
|
||||||
publish_coverage: false
|
publish_coverage: false
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ primaite setup
|
|||||||
#### Unix
|
#### Unix
|
||||||
|
|
||||||
**Prerequisites:**
|
**Prerequisites:**
|
||||||
* Manual install of Python >= 3.8 < 3.11
|
* Manual install of Python >= 3.8 < 3.12
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo add-apt-repository ppa:deadsnakes/ppa
|
sudo add-apt-repository ppa:deadsnakes/ppa
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ release = version
|
|||||||
|
|
||||||
# set global variables
|
# set global variables
|
||||||
rst_prolog = f"""
|
rst_prolog = f"""
|
||||||
.. |VERSION| replace:: {release} """ # noqa
|
.. |VERSION| replace:: {release}
|
||||||
|
"""
|
||||||
|
|
||||||
html_title = f"{project} v{release} docs"
|
html_title = f"{project} v{release} docs"
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ name = "primaite"
|
|||||||
description = "PrimAITE (Primary-level AI Training Environment) is a simulation environment for training AI under the ARCD programme."
|
description = "PrimAITE (Primary-level AI Training Environment) is a simulation environment for training AI under the ARCD programme."
|
||||||
authors = [{name="Defence Science and Technology Laboratory UK", email="oss@dstl.gov.uk"}]
|
authors = [{name="Defence Science and Technology Laboratory UK", email="oss@dstl.gov.uk"}]
|
||||||
license = {file = "LICENSE"}
|
license = {file = "LICENSE"}
|
||||||
requires-python = ">=3.8, <3.13"
|
requires-python = ">=3.8, <3.12"
|
||||||
dynamic = ["version", "readme"]
|
dynamic = ["version", "readme"]
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
@@ -20,6 +20,7 @@ classifiers = [
|
|||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: 3 :: Only",
|
"Programming Language :: Python :: 3 :: Only",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ class WebpageUnavailablePenalty(AbstractReward):
|
|||||||
|
|
||||||
# If the last request did actually go through, then check if the webpage also loaded
|
# If the last request did actually go through, then check if the webpage also loaded
|
||||||
web_browser_state = access_from_nested_dict(state, self.location_in_state)
|
web_browser_state = access_from_nested_dict(state, self.location_in_state)
|
||||||
if web_browser_state is NOT_PRESENT_IN_STATE or "history" not in web_browser_state: # noqa
|
if web_browser_state is NOT_PRESENT_IN_STATE or "history" not in web_browser_state:
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
"Web browser reward could not be calculated because the web browser history on node",
|
"Web browser reward could not be calculated because the web browser history on node",
|
||||||
f"{self._node} was not reported in the simulation state. Returning 0.0",
|
f"{self._node} was not reported in the simulation state. Returning 0.0",
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ def generate_mac_address(oui: Optional[str] = None) -> str:
|
|||||||
if oui:
|
if oui:
|
||||||
oui_pattern = re.compile(r"^([0-9A-Fa-f]{2}[:-]){2}[0-9A-Fa-f]{2}$")
|
oui_pattern = re.compile(r"^([0-9A-Fa-f]{2}[:-]){2}[0-9A-Fa-f]{2}$")
|
||||||
if not oui_pattern.match(oui):
|
if not oui_pattern.match(oui):
|
||||||
msg = f"Invalid oui. The oui should be in the format xx:xx:xx, where x is a hexadecimal digit, got '{oui}'" # noqa
|
msg = f"Invalid oui. The oui should be in the format xx:xx:xx, where x is a hexadecimal digit, got '{oui}'"
|
||||||
_LOGGER.error(msg)
|
_LOGGER.error(msg)
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
oui_bytes = [int(chunk, 16) for chunk in oui.split(":")]
|
oui_bytes = [int(chunk, 16) for chunk in oui.split(":")]
|
||||||
@@ -64,7 +64,7 @@ def generate_mac_address(oui: Optional[str] = None) -> str:
|
|||||||
else:
|
else:
|
||||||
mac = random_bytes
|
mac = random_bytes
|
||||||
|
|
||||||
return ":".join(f"{b:02x}" for b in mac) # noqa
|
return ":".join(f"{b:02x}" for b in mac)
|
||||||
|
|
||||||
|
|
||||||
class NetworkInterface(SimComponent, ABC):
|
class NetworkInterface(SimComponent, ABC):
|
||||||
@@ -599,7 +599,7 @@ class Link(SimComponent):
|
|||||||
@property
|
@property
|
||||||
def current_load_percent(self) -> str:
|
def current_load_percent(self) -> str:
|
||||||
"""Get the current load formatted as a percentage string."""
|
"""Get the current load formatted as a percentage string."""
|
||||||
return f"{self.current_load / self.bandwidth:.5f}%" # noqa
|
return f"{self.current_load / self.bandwidth:.5f}%"
|
||||||
|
|
||||||
def endpoint_up(self):
|
def endpoint_up(self):
|
||||||
"""Let the Link know and endpoint has been brought up."""
|
"""Let the Link know and endpoint has been brought up."""
|
||||||
@@ -652,7 +652,7 @@ class Link(SimComponent):
|
|||||||
# Load the frame size on the link
|
# Load the frame size on the link
|
||||||
self.current_load += frame_size
|
self.current_load += frame_size
|
||||||
_LOGGER.debug(
|
_LOGGER.debug(
|
||||||
f"Added {frame_size:.3f} Mbits to {self}, current load {self.current_load:.3f} Mbits " # noqa
|
f"Added {frame_size:.3f} Mbits to {self}, current load {self.current_load:.3f} Mbits "
|
||||||
f"({self.current_load_percent})"
|
f"({self.current_load_percent})"
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ class FTPServiceABC(Service, ABC):
|
|||||||
retrieved_file: File = self.file_system.get_file(folder_name=folder_name, file_name=file_name)
|
retrieved_file: File = self.file_system.get_file(folder_name=folder_name, file_name=file_name)
|
||||||
|
|
||||||
# if file does not exist, return an error
|
# if file does not exist, return an error
|
||||||
if not retrieved_file: # noqa
|
if not retrieved_file:
|
||||||
self.sys_log.error(
|
self.sys_log.error(
|
||||||
f"File {payload.ftp_command_args['dest_folder_name']}/"
|
f"File {payload.ftp_command_args['dest_folder_name']}/"
|
||||||
f"{payload.ftp_command_args['dest_file_name']} does not exist in {self.sys_log.hostname}"
|
f"{payload.ftp_command_args['dest_file_name']} does not exist in {self.sys_log.hostname}"
|
||||||
|
|||||||
Reference in New Issue
Block a user