Skip to content

Commit d2f2377

Browse files
authored
Merge pull request #1069 from slaclab/v4.11.11_Iterablefix
collections.Iterable -> collections.abc.Iterable
2 parents 9b6a976 + 54110a9 commit d2f2377

File tree

8 files changed

+162
-192
lines changed

8 files changed

+162
-192
lines changed

.github/workflows/rogue_ci.yml

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on: [push]
2121
jobs:
2222
full_build_test:
2323
name: Full Build Test
24-
runs-on: ubuntu-20.04
24+
runs-on: ubuntu-22.04
2525
steps:
2626

2727
# This step checks out a copy of your repository.
@@ -31,16 +31,7 @@ jobs:
3131

3232
- uses: actions/setup-python@v2
3333
with:
34-
python-version: 3.8
35-
36-
- name: Setup Environment
37-
run: |
38-
EPICS_BASE=${HOME}/packages/epics/base-7.0.3
39-
EPICS_PCAS_ROOT=${HOME}/packages/pcas/pcas-4.13.2
40-
LD_LIBRARY_PATH=/usr/lib:${EPICS_BASE}/lib/linux-x86_64:${EPICS_PCAS_ROOT}/lib/linux-x86_64
41-
echo "EPICS_BASE=$EPICS_BASE" >> $GITHUB_ENV
42-
echo "EPICS_PCAS_ROOT=$EPICS_PCAS_ROOT" >> $GITHUB_ENV
43-
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
34+
python-version: '3.10'
4435

4536
- name: Install dependencies
4637
run: |
@@ -51,30 +42,12 @@ jobs:
5142
pip install -r pip_requirements.txt
5243
pip install codecov coverage pytest-cov flake8
5344
54-
- name: Install EPICS Base
55-
run: |
56-
mkdir -p ${EPICS_BASE}
57-
cd ${EPICS_BASE}
58-
pwd
59-
wget -O base-7.0.3.tar.gz https://github.com/epics-base/epics-base/archive/R7.0.3.tar.gz
60-
tar xzf base-7.0.3.tar.gz --strip 1
61-
make clean && make && make install
62-
63-
- name: Install EPICS PCAS
64-
run: |
65-
mkdir -p ${EPICS_PCAS_ROOT}
66-
cd ${EPICS_PCAS_ROOT}
67-
wget -O pcas-4.13.2.tar.gz https://github.com/epics-modules/pcas/archive/v4.13.2.tar.gz
68-
tar xzf pcas-4.13.2.tar.gz --strip 1
69-
echo "EPICS_BASE=$EPICS_BASE" >> configure/RELEASE.local
70-
make clean && make && make install
71-
7245
# Rogue
7346
- name: Build Rogue
7447
run: |
7548
python -c "import numpy; print(numpy.get_include())"
7649
mkdir build; cd build
77-
cmake .. -DROGUE_INSTALL=local
50+
cmake .. -DROGUE_INSTALL=local -DNO_EPICS=1
7851
make -j4 install
7952
8053
# Run Tests
@@ -92,7 +65,7 @@ jobs:
9265
9366
small_build_test:
9467
name: Small Build Test
95-
runs-on: ubuntu-20.04
68+
runs-on: ubuntu-22.04
9669
steps:
9770

9871
# This step checks out a copy of your repository.
@@ -114,7 +87,7 @@ jobs:
11487
11588
gen_release:
11689
name: Generate Release
117-
runs-on: ubuntu-20.04
90+
runs-on: ubuntu-22.04
11891
needs: [full_build_test, small_build_test]
11992
if: startsWith(github.ref, 'refs/tags/')
12093
steps:

CMakeLists.txt

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# ----------------------------------------------------------------------------
22
# Title : ROGUE CMAKE Control
33
# ----------------------------------------------------------------------------
4-
# This file is part of the rogue software package. It is subject to
5-
# the license terms in the LICENSE.txt file found in the top-level directory
6-
# of this distribution and at:
7-
# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
8-
# No part of the rogue software package, including this file, may be
9-
# copied, modified, propagated, or distributed except according to the terms
4+
# This file is part of the rogue software package. It is subject to
5+
# the license terms in the LICENSE.txt file found in the top-level directory
6+
# of this distribution and at:
7+
# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
8+
# No part of the rogue software package, including this file, may be
9+
# copied, modified, propagated, or distributed except according to the terms
1010
# contained in the LICENSE.txt file.
1111
# ----------------------------------------------------------------------------
1212
# See notes for compiling on macros under anaconda:
@@ -40,7 +40,7 @@ add_definitions(-D__STDC_FORMAT_MACROS)
4040
#####################################
4141
# Boost + Python
4242
#####################################
43-
if ( NOT NO_PYTHON )
43+
if ( NOT NO_PYTHON )
4444
find_package(PythonInterp 3.6 QUIET REQUIRED)
4545
find_package(PythonLibs 3.6 QUIET REQUIRED)
4646

@@ -112,7 +112,7 @@ find_package(ZeroMQ QUIET)
112112

113113
# ZeroMQ does not always support cmake, use brute force
114114
if (NOT ZeroMQ_FOUND)
115-
115+
116116
# Convert LD_LIBRARY PATH for search
117117
if(DEFINED ENV{LD_LIBRARY_PATH})
118118
string(REPLACE ":" ";" HINT_PATHS $ENV{LD_LIBRARY_PATH})
@@ -121,12 +121,12 @@ if (NOT ZeroMQ_FOUND)
121121
endif()
122122

123123
# See if zmq library is in LD_LIBRARY_PATH
124-
find_library(ZeroMQ_LIBRARY
125-
NAMES zmq
124+
find_library(ZeroMQ_LIBRARY
125+
NAMES zmq
126126
PATHS ${HINT_PATHS})
127127

128128
# Found it
129-
if (ZeroMQ_LIBRARY)
129+
if (ZeroMQ_LIBRARY)
130130

131131
# Get the base directory
132132
get_filename_component(ZMQ_LIBDIR ${ZeroMQ_LIBRARY} DIRECTORY)
@@ -156,7 +156,7 @@ if((NOT NO_PYTHON) AND (NOT NO_EPICS) AND DEFINED ENV{EPICS_BASE})
156156
if(DEFINED ENV{EPICS_HOST_ARCH})
157157
set(EPICS_ARCH $ENV{EPICS_HOST_ARCH})
158158
else()
159-
execute_process(COMMAND ${EPICS_BASE_DIR}/startup/EpicsHostArch
159+
execute_process(COMMAND ${EPICS_BASE_DIR}/startup/EpicsHostArch
160160
OUTPUT_VARIABLE EPICS_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE)
161161
string(REGEX REPLACE "\n$" "" EPICS_ARCH "${EPICS_ARCH}")
162162
endif()
@@ -178,23 +178,23 @@ if((NOT NO_PYTHON) AND (NOT NO_EPICS) AND DEFINED ENV{EPICS_BASE})
178178

179179
set(EPICS_INCLUDES ${EPICS_PCAS_DIR}/include
180180
${EPICS_BASE_DIR}/include
181-
${EPICS_BASE_DIR}/include/compiler/gcc
181+
${EPICS_BASE_DIR}/include/compiler/gcc
182182
${EPICS_BASE_DIR}/include/os/Darwin)
183183

184-
set(EPICS_LIBRARIES ${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libcas.dylib
184+
set(EPICS_LIBRARIES ${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libcas.dylib
185185
${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libgdd.dylib
186-
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libca.dylib
186+
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libca.dylib
187187
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libCom.dylib )
188188
else()
189189

190190
set(EPICS_INCLUDES ${EPICS_PCAS_DIR}/include
191191
${EPICS_BASE_DIR}/include
192-
${EPICS_BASE_DIR}/include/compiler/gcc
192+
${EPICS_BASE_DIR}/include/compiler/gcc
193193
${EPICS_BASE_DIR}/include/os/Linux)
194194

195-
set(EPICS_LIBRARIES ${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libcas.so
195+
set(EPICS_LIBRARIES ${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libcas.so
196196
${EPICS_PCAS_DIR}/lib/${EPICS_ARCH}/libgdd.so
197-
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libca.so
197+
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libca.so
198198
${EPICS_BASE_DIR}/lib/${EPICS_ARCH}/libCom.so )
199199
endif()
200200
else()
@@ -204,7 +204,7 @@ endif()
204204
##########################################################
205205
# Generate version with GIT If Not Passed As -DVERSION
206206
##########################################################
207-
if ( NOT ROGUE_VERSION )
207+
if ( NOT ROGUE_VERSION )
208208

209209
# Set version from git tag
210210
find_package(Git QUIET)
@@ -226,7 +226,7 @@ endif()
226226
#####################################
227227

228228
# Default install type
229-
if ( NOT ROGUE_INSTALL )
229+
if ( NOT ROGUE_INSTALL )
230230
if (DEFINED ENV{CONDA_PREFIX})
231231
set (ROGUE_INSTALL "conda")
232232
else()
@@ -237,7 +237,7 @@ endif()
237237
# Default Install directory
238238
if (${ROGUE_INSTALL} STREQUAL "local")
239239
set (ROGUE_DIR ${PROJECT_SOURCE_DIR})
240-
elseif (NOT ROGUE_DIR)
240+
elseif (NOT ROGUE_DIR)
241241
if (${ROGUE_INSTALL} STREQUAL "custom")
242242
set (ROGUE_DIR "$ENV{CONDA_PREFIX}/${CMAKE_INSTALL_PREFIX}/rogue")
243243
elseif (${ROGUE_INSTALL} STREQUAL "conda")
@@ -300,7 +300,7 @@ else()
300300
TARGET_LINK_LIBRARIES(rogue-core-shared LINK_PUBLIC rt)
301301
endif()
302302

303-
if(STATIC_LIB)
303+
if(STATIC_LIB)
304304
add_library(rogue-core-static STATIC $<TARGET_OBJECTS:rogue-core> "")
305305
set_target_properties(rogue-core-static PROPERTIES OUTPUT_NAME librogue-core)
306306
set_target_properties(rogue-core-static PROPERTIES PREFIX "" SUFFIX ".a")
@@ -357,7 +357,7 @@ else()
357357
endif()
358358

359359
# Create the config file
360-
configure_file(${PROJECT_SOURCE_DIR}/templates/RogueConfig.cmake.in
360+
configure_file(${PROJECT_SOURCE_DIR}/templates/RogueConfig.cmake.in
361361
${PROJECT_BINARY_DIR}/RogueConfig.cmake @ONLY)
362362

363363
# Create the setup files
@@ -412,17 +412,17 @@ if (NOT NO_PYTHON)
412412
# Use setuptools with python3 for system
413413
elseif (${ROGUE_INSTALL} STREQUAL "system")
414414
install(CODE "execute_process(COMMAND python3 ${PROJECT_SOURCE_DIR}/build/setup.py install)")
415-
415+
416416
# Use setuptools with python for anaconda
417417
elseif (${ROGUE_INSTALL} STREQUAL "conda")
418-
install(CODE "execute_process(COMMAND python
418+
install(CODE "execute_process(COMMAND python
419419
${PROJECT_SOURCE_DIR}/build/setup.py install --prefix=${ROGUE_DIR})")
420420
endif()
421421

422422
# Do byte compile for custom or local
423423
if ((${ROGUE_INSTALL} STREQUAL "custom") OR (${ROGUE_INSTALL} STREQUAL "local"))
424424
install(CODE "execute_process(COMMAND python3 -m compileall ${ROGUE_DIR}/python)")
425-
endif()
425+
endif()
426426

427427
endif()
428428

patches/epics.patch

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
diff -ruN orig/epics-base-R3.15.5/src/ca/legacy/pcas/generic/caServerI.h epics-base-R3.15.5/src/ca/legacy/pcas/generic/caServerI.h
2+
--- orig/epics-base-R3.15.5/src/ca/legacy/pcas/generic/caServerI.h 2016-12-13 05:25:23
3+
+++ epics-base-R3.15.5/src/ca/legacy/pcas/generic/caServerI.h 2025-04-30 01:08:02
4+
@@ -88,8 +88,8 @@
5+
private:
6+
clientBufMemoryManager clientBufMemMgr;
7+
tsFreeList < casMonitor, 1024 > casMonitorFreeList;
8+
- tsDLList < casStrmClient > clientList;
9+
- tsDLList < casIntfOS > intfList;
10+
+ ::tsDLList < casStrmClient > clientList;
11+
+ ::tsDLList < casIntfOS > intfList;
12+
mutable epicsMutex mutex;
13+
mutable epicsMutex diagnosticCountersMutex;
14+
caServer & adapter;
15+
diff -ruN orig/epics-base-R3.15.5/src/ca/legacy/pcas/generic/casPVI.cc epics-base-R3.15.5/src/ca/legacy/pcas/generic/casPVI.cc
16+
--- orig/epics-base-R3.15.5/src/ca/legacy/pcas/generic/casPVI.cc 2016-12-13 05:25:23
17+
+++ epics-base-R3.15.5/src/ca/legacy/pcas/generic/casPVI.cc 2025-04-30 01:08:02
18+
@@ -288,7 +288,7 @@
19+
}
20+
21+
caStatus casPVI::installMonitor (
22+
- casMonitor & mon, tsDLList < casMonitor > & monitorList )
23+
+ casMonitor & mon, ::tsDLList < casMonitor > & monitorList )
24+
{
25+
epicsGuard < epicsMutex > guard ( this->mutex );
26+
assert ( this->nMonAttached < UINT_MAX );
27+
@@ -304,7 +304,7 @@
28+
}
29+
30+
casMonitor * casPVI::removeMonitor (
31+
- tsDLList < casMonitor > & list, ca_uint32_t clientIdIn )
32+
+ ::tsDLList < casMonitor > & list, ca_uint32_t clientIdIn )
33+
{
34+
epicsGuard < epicsMutex > guard ( this->mutex );
35+
casMonitor * pMon = 0;
36+
@@ -361,8 +361,8 @@
37+
}
38+
39+
void casPVI::removeChannel (
40+
- chanIntfForPV & chan, tsDLList < casMonitor > & src,
41+
- tsDLList < casMonitor > & dest )
42+
+ chanIntfForPV & chan, ::tsDLList < casMonitor > & src,
43+
+ ::tsDLList < casMonitor > & dest )
44+
{
45+
epicsGuard < epicsMutex > guard ( this->mutex );
46+
src.removeAll ( dest );
47+
@@ -376,7 +376,7 @@
48+
}
49+
}
50+
51+
-void casPVI::clearOutstandingReads ( tsDLList < casAsyncIOI > & ioList )
52+
+void casPVI::clearOutstandingReads ( ::tsDLList < casAsyncIOI > & ioList )
53+
{
54+
epicsGuard < epicsMutex > guard ( this->mutex );
55+
56+
@@ -396,7 +396,7 @@
57+
}
58+
}
59+
60+
-void casPVI::destroyAllIO ( tsDLList < casAsyncIOI > & ioList )
61+
+void casPVI::destroyAllIO ( ::tsDLList < casAsyncIOI > & ioList )
62+
{
63+
epicsGuard < epicsMutex > guard ( this->mutex );
64+
while ( casAsyncIOI * pIO = ioList.get() ) {
65+
@@ -408,7 +408,7 @@
66+
}
67+
68+
void casPVI::installIO (
69+
- tsDLList < casAsyncIOI > & ioList, casAsyncIOI & io )
70+
+ ::tsDLList < casAsyncIOI > & ioList, casAsyncIOI & io )
71+
{
72+
epicsGuard < epicsMutex > guard ( this->mutex );
73+
ioList.add ( io );
74+
@@ -417,7 +417,7 @@
75+
}
76+
77+
void casPVI::uninstallIO (
78+
- tsDLList < casAsyncIOI > & ioList, casAsyncIOI & io )
79+
+ ::tsDLList < casAsyncIOI > & ioList, casAsyncIOI & io )
80+
{
81+
{
82+
epicsGuard < epicsMutex > guard ( this->mutex );
83+
diff -ruN orig/epics-base-R3.15.5/src/ca/legacy/pcas/generic/casPVI.h epics-base-R3.15.5/src/ca/legacy/pcas/generic/casPVI.h
84+
--- orig/epics-base-R3.15.5/src/ca/legacy/pcas/generic/casPVI.h 2016-12-13 05:25:23
85+
+++ epics-base-R3.15.5/src/ca/legacy/pcas/generic/casPVI.h 2025-04-30 01:08:02
86+
@@ -49,21 +49,21 @@
87+
caStatus attachToServer ( caServerI & cas );
88+
aitIndex nativeCount ();
89+
bool ioIsPending () const;
90+
- void clearOutstandingReads ( tsDLList < class casAsyncIOI > &);
91+
+ void clearOutstandingReads ( ::tsDLList < class casAsyncIOI > &);
92+
void destroyAllIO (
93+
- tsDLList < casAsyncIOI > & );
94+
+ ::tsDLList < casAsyncIOI > & );
95+
void installIO (
96+
- tsDLList < casAsyncIOI > &, casAsyncIOI & );
97+
+ ::tsDLList < casAsyncIOI > &, casAsyncIOI & );
98+
void uninstallIO (
99+
- tsDLList < casAsyncIOI > &, casAsyncIOI & );
100+
+ ::tsDLList < casAsyncIOI > &, casAsyncIOI & );
101+
void installChannel ( chanIntfForPV & chan );
102+
void removeChannel (
103+
- chanIntfForPV & chan, tsDLList < casMonitor > & src,
104+
- tsDLList < casMonitor > & dest );
105+
+ chanIntfForPV & chan, ::tsDLList < casMonitor > & src,
106+
+ ::tsDLList < casMonitor > & dest );
107+
caStatus installMonitor (
108+
- casMonitor & mon, tsDLList < casMonitor > & monitorList );
109+
+ casMonitor & mon, ::tsDLList < casMonitor > & monitorList );
110+
casMonitor * removeMonitor (
111+
- tsDLList < casMonitor > & list, ca_uint32_t clientIdIn );
112+
+ ::tsDLList < casMonitor > & list, ca_uint32_t clientIdIn );
113+
void deleteSignal ();
114+
void postEvent ( const casEventMask & select, const gdd & event );
115+
caServer * getExtServer () const;
116+
@@ -84,7 +84,7 @@
117+
118+
private:
119+
mutable epicsMutex mutex;
120+
- tsDLList < chanIntfForPV > chanList;
121+
+ ::tsDLList < chanIntfForPV > chanList;
122+
gddEnumStringTable enumStrTbl;
123+
caServerI * pCAS;
124+
casPV * pPV;

python/pyrogue/_Device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def _rawTxnChunker(self, offset, data, base=pr.UInt, stride=4, wordBitSize=32, t
386386
if txnType == rim.Write or txnType == rim.Post:
387387
if isinstance(data, bytearray):
388388
ldata = data
389-
elif isinstance(data, collections.Iterable):
389+
elif isinstance(data, collections.abc.Iterable):
390390
ldata = b''.join(base.toBytes(word) for word in data)
391391
else:
392392
ldata = base.toBytes(data)

python/pyrogue/_Node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def add(self,node):
247247
"""Add node as sub-node"""
248248

249249
# Special case if list (or iterable of nodes) is passed
250-
if isinstance(node, collections.Iterable) and all(isinstance(n, Node) for n in node):
250+
if isinstance(node, collections.abc.Iterable) and all(isinstance(n, Node) for n in node):
251251
for n in node:
252252
self.add(n)
253253
return

python/pyrogue/_Variable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import time
2121
import numpy
2222
from collections import OrderedDict as odict
23-
from collections import Iterable
23+
from collections.abc import Iterable
2424

2525
class VariableError(Exception):
2626
""" Exception for variable access errors."""

0 commit comments

Comments
 (0)