Skip to content
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
9 changes: 1 addition & 8 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ on:
jobs:
build-server:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
strategy:
matrix:
include:
- python-version: "3.6"
container: "python:3.6"
- python-version: "3.7"
container: "python:3.7"
- python-version: "3.8"
- python-version: "3.9"
- python-version: "3.10"
- python-version: "3.11"
Expand All @@ -35,7 +29,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
if: ${{ !matrix.container }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -66,4 +59,4 @@ jobs:
python -m pip install .
- name: Test with pytest
run: |
pytest
pytest --log-cli-level=DEBUG
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ repos:
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.0
rev: v0.15.0
hooks:
# Run the linter.
- id: ruff
- id: ruff-check
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.12.1"
hooks:
- id: pyproject-fmt

#- repo: https://github.com/pre-commit/mirrors-clang-format
# rev: v15.0.7
# hooks:
Expand Down
52 changes: 27 additions & 25 deletions server/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = [ "setuptools" ]

[project]
name="recceiver"
name = "recceiver"
version = "1.8dev"
description = "recCeiver is a server component of the recsync protocol. It receives record updates from recsync clients (e.g., recCasters) and forwards them to a configurable backend such as ChannelFinder."
readme = "README.md"
authors = [
{name = "Michael Davidsaver", email = "mdavidsaver@gmail.com"},
{ name = "Michael Davidsaver", email = "mdavidsaver@gmail.com" },
]
requires-python = ">=3.9"
classifiers = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove 3.6. - 3.8

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you not need 3.6 anymore? I'm happy to remove.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I read "default" in the PR description as planning to get rid of 3.6-3.8

It's up to the community what to do. I think there's value in making life easiest on the people using/deploying software in these open source projects. So it is good to keep support for older versions when it's not too much hassle and I would say keep 3.6. But I am fine moving to 3.9 too (RHEL 9 default) if no one else wants 3.6 support.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wary of going beyond the python supported versions https://devguide.python.org/versions/. 3.9 is already end of life. Wouldn't be surprised if that starts breaking the ci soon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh, I think the hassle is worth it to help the lab setups where there might just be one person trying to maintain all this EPICS software. But just my opinion

Copy link

@ralphlange ralphlange Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
At ITER - at 1 million records with less than 10 of ~160 plant systems delivered - we are struggling to migrate everything to RHEL 8 (that uses Python 3.6 as standard).

"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
description="resync server"
version="1.5"
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
"dataclasses; python_version < '3.7'",
"requests",
"twisted",
"channelfinder @ https://github.com/ChannelFinder/pyCFClient/archive/refs/tags/v3.0.0.zip"
"channelfinder @ https://github.com/ChannelFinder/pyCFClient/archive/refs/tags/v3.0.0.zip",
"dataclasses; python_version<'3.7'",
"requests",
"twisted",
]

[project.optional-dependencies]
test = ["pytest", "testcontainers>=4"]

[project.urls]
Repository="https://github.com/mdavidsaver/recsync"
optional-dependencies.test = [ "pytest", "testcontainers>=4" ]
urls.Repository = "https://github.com/ChannelFinder/recsync"

[tool.setuptools]
packages = ["recceiver", "twisted.plugins"]
packages = [ "recceiver", "twisted.plugins" ]
include-package-data = true

[tool.setuptools.package-data]
twisted = ["plugins/recceiver_plugin.py"]

[tool.pytest.ini_options]
log_cli = true
log_cli_level = "DEBUG"
twisted = [ "plugins/recceiver_plugin.py" ]

[tool.ruff]
line-length = 120
target-version = "py39"

[tool.ruff.lint]
line-length = 120
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E", "F", "I"]
lint.select = [ "E", "F", "I" ]
6 changes: 3 additions & 3 deletions server/recceiver/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import logging
import random

from zope.interface import implementer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is moving these imports necessary? same goes for all the other import changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its from the latest version of ruff, the formatter must have changed to order the imports differently.


from twisted import plugin
from twisted.application import service
from twisted.internet import defer, pollreactor
from twisted.internet.error import CannotListenError
from twisted.python import log, usage
from zope.interface import implementer

from twisted import plugin

from .announce import Announcer
from .processors import ProcessorController
Expand Down
7 changes: 3 additions & 4 deletions server/recceiver/cfstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@

from channelfinder import ChannelFinderClient
from requests import ConnectionError, RequestException
from zope.interface import implementer

from twisted.application import service
from twisted.internet import defer
from twisted.internet.defer import DeferredLock
from twisted.internet.threads import deferToThread
from zope.interface import implementer

from . import interfaces
from .interfaces import CommitTransaction
Expand All @@ -31,7 +30,7 @@
DEFAULT_QUERY_LIMIT = 10_000


class PVStatus(enum.StrEnum):
class PVStatus(str, enum.Enum):
"""PV Status values."""

ACTIVE = "Active"
Expand Down Expand Up @@ -170,7 +169,7 @@ class RecordInfo:
aliases: List[str] = field(default_factory=list)


class CFPropertyName(enum.StrEnum):
class CFPropertyName(str, enum.Enum):
"""Standard property names used in Channelfinder."""

HOSTNAME = "hostName"
Expand Down
3 changes: 1 addition & 2 deletions server/recceiver/dbstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import itertools
import logging

from zope.interface import implementer

from twisted.application import service
from twisted.enterprise import adbapi as db
from twisted.internet import defer
from zope.interface import implementer

from . import interfaces

Expand Down
3 changes: 1 addition & 2 deletions server/recceiver/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
from dataclasses import dataclass
from typing import Dict, List, Set, Tuple

from zope.interface import Attribute, Interface

from twisted.application import service
from zope.interface import Attribute, Interface


class ITransaction(Interface):
Expand Down
1 change: 0 additions & 1 deletion server/recceiver/mock_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from requests import HTTPError

from twisted.internet.address import IPv4Address


Expand Down
4 changes: 2 additions & 2 deletions server/recceiver/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from configparser import ConfigParser as Parser
from os.path import expanduser

from twisted.application import service
from twisted.internet import defer, task
from zope.interface import implementer

from twisted import plugin
from twisted.application import service
from twisted.internet import defer, task

from . import interfaces

Expand Down
3 changes: 1 addition & 2 deletions server/recceiver/recast.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
import sys
import time

from zope.interface import implementer

from twisted.internet import defer, protocol
from twisted.protocols import stateful
from zope.interface import implementer

from .interfaces import ITransaction

Expand Down
2 changes: 1 addition & 1 deletion server/tests/test_bash_ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
from typing import Optional

from channelfinder import ChannelFinderClient
from docker.models.containers import Container
from testcontainers.compose import DockerCompose

from docker import DockerClient
from docker.models.containers import Container

from .client_checks import (
BASE_IOC_CHANNEL_COUNT,
Expand Down
Loading