Skip to content
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
publish-to-pypi:
name: Publish a Python distribution to PyPI
if: ${{ github.repository == 'p4lang/p4runtime-shell' }}
runs-on: [ubuntu-latest]
runs-on: [ubuntu-26.04]
steps:
- uses: actions/checkout@v7
- name: Set up Python
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
verify-licenses:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04
name: Validate that all files have copyright and license info
steps:
- uses: actions/checkout@v7
Expand All @@ -25,7 +25,7 @@ jobs:
run: |
uv run reuse lint
test:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04
# Local registry where we output p4lang/p4runtime-sh so that it can be used
# to build p4lang/p4runtime-sh-dev.
services:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
toc:
runs-on: ubuntu-latest
runs-on: ubuntu-26.04
steps:
- name: Check-out code
uses: actions/checkout@v7
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SPDX-FileCopyrightText: 2019 Antonin Bas
#
# SPDX-License-Identifier: Apache-2.0
FROM ubuntu:22.04 AS deps
FROM ubuntu:26.04 AS deps

SHELL ["/bin/bash", "-c"]
ENV PKG_DEPS python3 python3-venv git
ENV VENV /p4runtime-sh/venv
ENV PKG_DEPS="python3 python3-venv git"
ENV VENV=/p4runtime-sh/venv

RUN apt-get update && \
apt-get install -y --no-install-recommends $PKG_DEPS && \
Expand All @@ -22,13 +22,13 @@ RUN python3 -m venv $VENV && \
pip3 install . && \
rm -rf ~/.cache/pip

FROM ubuntu:22.04
FROM ubuntu:26.04
LABEL maintainer="P4 Developers <p4-dev@lists.p4.org>"
LABEL description="A shell based on ipython3 for P4Runtime"

# Any easy way to avoid installing these packages again?
ENV PKG_DEPS python3
ENV VENV /p4runtime-sh/venv
ENV PKG_DEPS=python3
ENV VENV=/p4runtime-sh/venv

RUN apt-get update && \
apt-get install -y --no-install-recommends $PKG_DEPS && \
Expand Down
4 changes: 2 additions & 2 deletions p4runtime_sh/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self):
def reset(self):
"""Reset all options to their defaults."""
for option in Options:
assert(option in GlobalOptions.option_defaults)
assert option in GlobalOptions.option_defaults
self._values[option] = GlobalOptions.option_defaults[option]

def _supported_options_as_str(self):
Expand Down Expand Up @@ -102,7 +102,7 @@ def set(self, name, value):
option = Options[name]
except KeyError:
raise UnknownOptionName(name)
if type(value) != option.value:
if type(value) is not option.value:
raise InvalidOptionValueType(option, value)
self.set_option(option, value)

Expand Down
4 changes: 2 additions & 2 deletions p4runtime_sh/p4runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, message):
# Used to iterate over the p4.Error messages in a gRPC error Status object
class P4RuntimeErrorIterator:
def __init__(self, grpc_error):
assert(grpc_error.code() == grpc.StatusCode.UNKNOWN)
assert grpc_error.code() == grpc.StatusCode.UNKNOWN
self.grpc_error = grpc_error

error = None
Expand Down Expand Up @@ -71,7 +71,7 @@ def __next__(self):
# documentation for more details on error-reporting.
class P4RuntimeWriteException(Exception):
def __init__(self, grpc_error):
assert(grpc_error.code() == grpc.StatusCode.UNKNOWN)
assert grpc_error.code() == grpc.StatusCode.UNKNOWN
super().__init__()
self.errors = []
try:
Expand Down
2 changes: 1 addition & 1 deletion p4runtime_sh/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def msg(self):
return msg

def _from_msg(self, msg):
assert(self._action_id == msg.action_id)
assert self._action_id == msg.action_id
self._param_values.clear()
for p in msg.params:
p_name = context.get_param_name(self.action_name, p.param_id)
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
#
# SPDX-License-Identifier: Apache-2.0

flake8==3.8.4
nose2==0.9.2
flake8==7.4.1
nose2==0.16.0
callee==0.3.1
Loading