Skip to content

Commit

Permalink
Bump actions/setup-python from 4.4.0 to 4.6.0 (#52)
Browse files Browse the repository at this point in the history
* Bump actions/setup-python from 4.4.0 to 4.6.0

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.4.0 to 4.6.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4.4.0...v4.6.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and pre-commit-ci[bot] authored May 20, 2023
1 parent 49961d6 commit b6a62e0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

- name: Set up python
id: setup-python
uses: actions/setup-python@v4.4.0
uses: actions/setup-python@v4.6.0
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
Expand Down
36 changes: 24 additions & 12 deletions uoshardware/abstractions.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ def execute_instruction(self, packet: NPCPacket) -> ComResult: # dead: disable
:param packet: A tuple containing the uint8 npc packet for the UOS instruction.
:returns: ComResult object.
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
:raises: UOSCommunicationError if there is a problem completing the action.
:raises: UOSUnsupportedError if the interface hasn't been built
correctly.
:raises: UOSCommunicationError if there is a problem completing
the action.
"""
raise UOSUnsupportedError(
f"UOSInterfaces must over-ride {UOSInterface.execute_instruction.__name__} prototype."
Expand All @@ -200,8 +202,10 @@ def read_response(
:param expect_packets: How many packets including ACK to expect
:param timeout_s: The maximum time this function will wait for data.
:return: COM Result object.
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
:raises: UOSCommunicationError if there is a problem completing the action.
:raises: UOSUnsupportedError if the interface hasn't been built
correctly.
:raises: UOSCommunicationError if there is a problem completing
the action.
"""
raise UOSUnsupportedError(
f"UOSInterfaces must over-ride {UOSInterface.read_response.__name__} prototype."
Expand All @@ -212,8 +216,10 @@ def hard_reset(self) -> ComResult:
"""UOS loop reset functionality should be as hard a reset as possible.
:return: COM Result object.
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
:raises: UOSCommunicationError if there is a problem completing the action.
:raises: UOSUnsupportedError if the interface hasn't been built
correctly.
:raises: UOSCommunicationError if there is a problem completing
the action.
"""
raise UOSUnsupportedError(
f"UOSInterfaces must over-ride {UOSInterface.hard_reset.__name__} prototype"
Expand All @@ -223,8 +229,10 @@ def hard_reset(self) -> ComResult:
def open(self):
"""Abstract method for opening a connection to a UOSInterface.
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
:raises: UOSCommunicationError if there is a problem completing the action.
:raises: UOSUnsupportedError if the interface hasn't been built
correctly.
:raises: UOSCommunicationError if there is a problem completing
the action.
"""
raise UOSUnsupportedError(
f"UOSInterfaces must over-ride {UOSInterface.open.__name__} prototype."
Expand All @@ -234,8 +242,10 @@ def open(self):
def close(self):
"""Abstract method for closing a connection to a UOSInterface.
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
:raises: UOSCommunicationError if there is a problem completing the action.
:raises: UOSUnsupportedError if the interface hasn't been built
correctly.
:raises: UOSCommunicationError if there is a problem completing
the action.
"""
raise UOSUnsupportedError(
f"UOSInterfaces must over-ride {UOSInterface.close.__name__} prototype."
Expand All @@ -246,7 +256,8 @@ def is_active(self) -> bool:
"""Abstract method for checking if a connection is being held active.
:return: Success boolean.
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
:raises: UOSUnsupportedError if the interface hasn't been built
correctly.
"""
raise UOSUnsupportedError(
f"UOSInterfaces must over-ride {UOSInterface.close.__name__} prototype."
Expand All @@ -258,7 +269,8 @@ def enumerate_devices() -> list:
"""Return a list of UOSDevices visible to the driver.
:return: A list of possible UOSInterfaces on the server.
:raises: UOSUnsupportedError if the interface hasn't been built correctly.
:raises: UOSUnsupportedError if the interface hasn't been built
correctly.
"""
raise UOSUnsupportedError(
f"UOSInterfaces must over-ride {UOSInterface.enumerate_devices.__name__} prototype."
Expand Down
15 changes: 10 additions & 5 deletions uoshardware/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class UOSDevice: # dead: disable
"""Class for high level object-orientated control of UOS devices.
:ivar identity: The type of device, this is must have a valid device in the config.
:ivar address: Compliant connection string for identifying the device and interface.
:ivar address: Compliant connection string for identifying the
device and interface.
"""

__device: Device # Device definitions as parsed from a compatible ini.
Expand Down Expand Up @@ -158,9 +159,11 @@ def get_gpio_input(
) -> ComResult:
"""Read a GPIO pins level from device and returns the value.
:param pin: The numeric number of the pin as defined in the dictionary for that device.
:param pin: The numeric number of the pin as defined in the
dictionary for that device.
:param pull_up: Enable the internal pull-up resistor. Default is false.
:param volatility: How volatile should the command be, use constants from uoshardware.
:param volatility: How volatile should the command be, use
constants from uoshardware.
:return: ComResult object.
"""
result = self.__execute_instruction(
Expand Down Expand Up @@ -210,7 +213,8 @@ def get_system_info(self) -> ComResult:
def reset_all_io(self, volatility=Persistence.RAM) -> ComResult:
"""Execute the reset IO at the defined volatility level.
:param volatility: Where should the pins reset from, use constants from uoshardware.
:param volatility: Where should the pins reset from, use
constants from uoshardware.
:return: ComResult object containing the result of the reset operation..
"""
return self.__execute_instruction(
Expand Down Expand Up @@ -251,7 +255,8 @@ def __execute_instruction(
:param instruction_data: device_functions from the LUT, payload ect.
:param retry: Allows the instruction to retry execution when fails.
:return: ComResult object
:raises: UOSUnsupportedError if function is not possible on the loaded device.
:raises: UOSUnsupportedError if function is not possible on the
loaded device.
"""
if (
function.name not in self.__device.functions_enabled
Expand Down
9 changes: 6 additions & 3 deletions uoshardware/interface/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class Serial(UOSInterface):
"""Pyserial class that handles reading / writing to ports.
:ivar _device: Holds the pyserial device once opened. None if not opened.
:ivar _connection: Holds the standard connection string 'Interface'|'OS Connection String.
:ivar _connection: Holds the standard connection string
'Interface'|'OS Connection String.
:ivar _port: Holds the port class, none type if device not instantiated.
:ivar _kwargs: Additional keyword arguments as defined in the documentation.
"""
Expand Down Expand Up @@ -100,7 +101,8 @@ def execute_instruction(self, packet: NPCPacket):
"""Build and execute a new instruction packet.
:param packet: A tuple containing the uint8 npc packet for the UOS instruction.
:return: Tuple containing a status boolean and index 0 and a result-set dict at index 1.
:return: Tuple containing a status boolean and index 0 and a
result-set dict at index 1.
"""
if self._device is None:
raise UOSCommunicationError(
Expand Down Expand Up @@ -171,7 +173,8 @@ def read_response(self, expect_packets: int, timeout_s: float):
def hard_reset(self):
"""Manually drive the DTR line low to reset the device.
:return: Tuple containing a status boolean and index 0 and a result-set dict at index 1.
:return: Tuple containing a status boolean and index 0 and a
result-set dict at index 1.
"""
if self._device is None:
raise UOSCommunicationError("Connection must be open to hard reset device.")
Expand Down

0 comments on commit b6a62e0

Please sign in to comment.