osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/41387?usp=email )
Change subject: lint/lint_diff: test_ruff: add pyosmocom
......................................................................
lint/lint_diff: test_ruff: add pyosmocom
Ruff is very fast and detects some additional things that pylint (which
is already used with pyosmocom) does not.
Depends: pyosmocom I2ca3135f1ce38dcc06dc95c38f4b6258a60121cd
Change-Id: I2fdb36c79efbd0f0fb4bdce3cd0045bb35d4cf64
---
M lint/lint_diff.sh
1 file changed, 1 insertion(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/87/41387/1
diff --git a/lint/lint_diff.sh b/lint/lint_diff.sh
index d76d951..6d8c64b 100755
--- a/lint/lint_diff.sh
+++ b/lint/lint_diff.sh
@@ -85,6 +85,7 @@
osmo-ci
osmo-dev
osmo-ttcn3-hacks
+ pyosmocom
"
local format_projects="
osmo-ttcn3-hacks
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/41387?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I2fdb36c79efbd0f0fb4bdce3cd0045bb35d4cf64
Gerrit-Change-Number: 41387
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/41381?usp=email )
Change subject: Fix lint errors: unused imports
......................................................................
Fix lint errors: unused imports
This is the first patch in a series to address everything found with
"ruff check", so we can run it in CI (additionally to pylint) and
locally as pre-commit hook.
Change-Id: Ie71039d05e9a7cc8b65543c9475b35adcb458f7e
---
M src/osmocom/construct.py
M src/osmocom/gsmtap.py
M src/osmocom/gsup/message.py
3 files changed, 1 insertion(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/81/41381/1
diff --git a/src/osmocom/construct.py b/src/osmocom/construct.py
index 5e062c3..a7e5f41 100644
--- a/src/osmocom/construct.py
+++ b/src/osmocom/construct.py
@@ -4,7 +4,6 @@
import codecs
import ipaddress
-import gsm0338
# pylint: disable=import-error,no-name-in-module
diff --git a/src/osmocom/gsmtap.py b/src/osmocom/gsmtap.py
index f21ba03..60d7ee4 100644
--- a/src/osmocom/gsmtap.py
+++ b/src/osmocom/gsmtap.py
@@ -23,7 +23,6 @@
#
import socket
-from construct import Optional as COptional
from construct import Int8ub, Int8sb, Int32ub, BitStruct, Enum, GreedyBytes, Struct, Switch
from construct import this, PaddedString, Flag, BitsInteger, Bytes
from osmocom.construct import *
diff --git a/src/osmocom/gsup/message.py b/src/osmocom/gsup/message.py
index e48cd54..31fab2c 100644
--- a/src/osmocom/gsup/message.py
+++ b/src/osmocom/gsup/message.py
@@ -30,7 +30,7 @@
from construct import Optional as COptional
from osmocom.tlv import TLV_IE, TLV_IE_Collection
-from osmocom.construct import TonNpi, Rpad, OsmoRatType
+from osmocom.construct import TonNpi, OsmoRatType
from osmocom.construct import PaddedBcdAdapter, DnsAdapter, Ipv4Adapter, Ipv6Adapter
class GSUP_TLV_IE(TLV_IE):
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/41381?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Ie71039d05e9a7cc8b65543c9475b35adcb458f7e
Gerrit-Change-Number: 41381
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/41385?usp=email )
Change subject: Fix lint errors: avoid equality comparisons to `False`
......................................................................
Fix lint errors: avoid equality comparisons to `False`
src/osmocom/utils.py:150:8: E712 Avoid equality comparisons to `False`; use `if not signed:` for false checks
|
148 | """
149 |
150 | if signed == False and number < 0:
| ^^^^^^^^^^^^^^^ E712
151 | raise ValueError("expecting a positive number")
|
= help: Replace with `not signed`
Change-Id: I2ebb33c498b4a7e6229980462aa51b579fa4f782
---
M src/osmocom/utils.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/85/41385/1
diff --git a/src/osmocom/utils.py b/src/osmocom/utils.py
index 3991da2..7963c05 100644
--- a/src/osmocom/utils.py
+++ b/src/osmocom/utils.py
@@ -147,7 +147,7 @@
Integer 'nbytes', which is the number of bytes required to encode 'number'
"""
- if signed == False and number < 0:
+ if not signed and number < 0:
raise ValueError("expecting a positive number")
# Compute how many bytes we need for the absolute (positive) value of the given number
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/41385?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I2ebb33c498b4a7e6229980462aa51b579fa4f782
Gerrit-Change-Number: 41385
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/41380?usp=email )
Change subject: README: mention the pypi package
......................................................................
README: mention the pypi package
Make it easy for users to verify that the pyosmocom project from pypi
comes from the maintainers of this repository by clicking the URL and
finding the "pip install pyosmocom" line in the README.
Change-Id: Iac6fcbc1b5f0caa4cf63de5b8effe46d731080bc
---
M README.md
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/80/41380/1
diff --git a/README.md b/README.md
index 1d98601..c97a8ac 100644
--- a/README.md
+++ b/README.md
@@ -10,3 +10,9 @@
* utilities for common problems found in mobile communications
* TLV parsers/encoders
* helpers for 'construct' based encoders/decoders
+
+Releases get published to [pypi](https://pypi.org/project/pyosmocom/) and can
+be installed with:
+```
+$ pip install pyosmocom
+```
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/41380?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: Iac6fcbc1b5f0caa4cf63de5b8effe46d731080bc
Gerrit-Change-Number: 41380
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/python/pyosmocom/+/41386?usp=email )
Change subject: Fix lint errors: test for membership should be `not in`
......................................................................
Fix lint errors: test for membership should be `not in`
src/osmocom/tlv.py:477:16: E713 [*] Test for membership should be `not in`
|
475 | key-value pair, where the key is the snake-reformatted type name of 'self'"""
476 | expected_key_name = camel_to_snake(type(self).__name__)
477 | if not expected_key_name in decoded:
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E713
478 | raise ValueError("Dict %s doesn't contain expected key %s" % (decoded, expected_key_name))
479 | self.from_val_dict(decoded[expected_key_name])
|
= help: Convert to `not in`
Change-Id: I2ca3135f1ce38dcc06dc95c38f4b6258a60121cd
---
M src/osmocom/tlv.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/python/pyosmocom refs/changes/86/41386/1
diff --git a/src/osmocom/tlv.py b/src/osmocom/tlv.py
index 93e4e87..14c22f0 100644
--- a/src/osmocom/tlv.py
+++ b/src/osmocom/tlv.py
@@ -474,7 +474,7 @@
This method is symmetrical to to_dict() above, i.e. the outer dict must contain just a single
key-value pair, where the key is the snake-reformatted type name of 'self'"""
expected_key_name = camel_to_snake(type(self).__name__)
- if not expected_key_name in decoded:
+ if expected_key_name not in decoded:
raise ValueError("Dict %s doesn't contain expected key %s" % (decoded, expected_key_name))
self.from_val_dict(decoded[expected_key_name])
--
To view, visit https://gerrit.osmocom.org/c/python/pyosmocom/+/41386?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: python/pyosmocom
Gerrit-Branch: master
Gerrit-Change-Id: I2ca3135f1ce38dcc06dc95c38f4b6258a60121cd
Gerrit-Change-Number: 41386
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/41379?usp=email )
Change subject: OBS: fix building pyosmocom for debian 12
......................................................................
OBS: fix building pyosmocom for debian 12
Related: pyosmocom I8416234ea02f337fabd075cc345af964c1b71adf
Related: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#licen…
Change-Id: Ia8ef3a0301aeaad4691c197ed780e86b497def4a
---
M scripts/obs/lib/srcpkg.py
1 file changed, 12 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, approved
diff --git a/scripts/obs/lib/srcpkg.py b/scripts/obs/lib/srcpkg.py
index 1b31f84..b3e0422 100644
--- a/scripts/obs/lib/srcpkg.py
+++ b/scripts/obs/lib/srcpkg.py
@@ -147,6 +147,18 @@
lib.run_cmd(["sh", "-e", script], cwd=repo_path)
+def prepare_project_pyosmocom():
+ """The format of the license field in pyproject.toml was changed from a
+ "table" to a a string with an SPDX license expression. The sources have
+ been adjusted to use the new format to appease a warning ("By 2026-Feb-18,
+ you need to update your project and remove deprecated calls or your builds
+ will no longer be supported."). However now the build fails with setuptools
+ from Debian 12. Remove the license line from pyproject.toml, the debian
+ packaging has its own license information in debian/copyright."""
+ repo_path = lib.git.get_repo_path("pyosmocom")
+ lib.run_cmd(["sed", "-i", "/^license = /d", "pyproject.toml"], cwd=repo_path)
+
+
def run_generate_build_dep(project):
"""Run contrib/generate_build_dep.sh if it exists in the given project, to
to download sources for dependencies (see e.g. osmo_dia2gsup.git)."""
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/41379?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ia8ef3a0301aeaad4691c197ed780e86b497def4a
Gerrit-Change-Number: 41379
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: fixeria, pespin.
osmith has posted comments on this change by osmith. ( https://gerrit.osmocom.org/c/osmo-ci/+/41379?usp=email )
Change subject: OBS: fix building pyosmocom for debian 12
......................................................................
Patch Set 2: Code-Review+2
(1 comment)
Patchset:
PS2:
Pau reviewed it and acked it in chat. Merging now, as without this we will have broken nightly pyosmocom debian 12 packages.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/41379?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: Ia8ef3a0301aeaad4691c197ed780e86b497def4a
Gerrit-Change-Number: 41379
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 07 Nov 2025 14:15:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes