Skip to content

Commit 917077d

Browse files
committed
Drop py2.7
1 parent f90f3a5 commit 917077d

2 files changed

Lines changed: 18 additions & 26 deletions

File tree

.github/workflows/python.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@ jobs:
1717
include:
1818
# see compat matrix: https://github.com/pypa/manylinux
1919

20-
- ml: manylinux1_x86_64
21-
py: cp27-cp27m
22-
cy: "Cython<3.0"
23-
skip: true
24-
25-
- ml: manylinux2010_x86_64
26-
py: cp37-cp37m
27-
skip: true
28-
2920
- ml: manylinux2010_x86_64
3021
py: cp38-cp38
3122
skip: true

setup.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
from glob import glob
77

8-
from distutils import log
9-
from distutils.errors import CompileError
108
from setuptools import Command, Distribution
119
from setuptools_dso import DSO, Extension, setup, build_dso, ProbeToolchain
1210
from epicscorelibs.config import get_config_var
@@ -48,8 +46,8 @@ def cexpand(iname, oname, defs={}, dry_run=False):
4846
4947
defs dict used to expand "@MACRO@", or replace "#cmakedefine MACRO VALUE" lines
5048
"""
51-
log.info('expand %s -> %s', iname, oname)
52-
log.debug('With %s', defs)
49+
print('expand %s -> %s', iname, oname)
50+
print('With %s', defs)
5351
with open(iname, 'r') as F:
5452
inp = F.read()
5553

@@ -70,12 +68,12 @@ def csub(M):
7068
out = re.sub(r'^\s*#\s*cmakedefine\s+([^\s]+)(?:\s+(.*))?$', csub, out, 0, re.MULTILINE)
7169

7270
if dry_run:
73-
log.info('Would write %s', oname)
71+
print('Would write %s', oname)
7472
else:
75-
log.info('Write %s', oname)
76-
log.info('>>>>>>>>')
77-
log.info('%s', out)
78-
log.info('<<<<<<<<')
73+
print('Write %s', oname)
74+
print('>>>>>>>>')
75+
print('%s', out)
76+
print('<<<<<<<<')
7977
with open(oname, 'w') as F:
8078
F.write(out)
8179

@@ -108,7 +106,7 @@ def finalize_options(self):
108106

109107
@logexc
110108
def run(self):
111-
log.info("In Expand")
109+
print("In Expand")
112110
self.mkpath(os.path.join(self.build_temp, 'event2'))
113111
self.mkpath(os.path.join(self.build_lib, 'pvxslibs', 'include', 'pvxs'))
114112
self.mkpath(os.path.join(self.build_lib, 'pvxslibs', 'dbd'))
@@ -373,7 +371,9 @@ def run(self):
373371
mangled_type = type.upper().replace(' ','_').replace('*', 'P')
374372
try:
375373
DEFS['EVENT__SIZEOF_'+mangled_type] = str(probe.sizeof(type))
376-
except CompileError:
374+
except Exception as e:
375+
if e.__class__.__name__!='CompileError':
376+
raise # see https://github.com/epics-base/setuptools_dso/issues/45
377377
DEFS['EVENT__SIZEOF_'+mangled_type] = '0'
378378
DEFS['EVENT__HAVE_'+mangled_type] = None
379379
else:
@@ -382,7 +382,9 @@ def run(self):
382382
try:
383383
DEFS['EVENT__SIZEOF_SSIZE_T'] = str(probe.sizeof('ssize_t'))
384384
DEFS['EVENT__ssize_t'] = 'ssize_t'
385-
except CompileError:
385+
except Exception as e:
386+
if e.__class__.__name__!='CompileError':
387+
raise # see https://github.com/epics-base/setuptools_dso/issues/45
386388
DEFS['EVENT__SIZEOF_SSIZE_T'] = str(probe.sizeof('SSIZE_T'))
387389
DEFS['EVENT__ssize_t'] = 'SSIZE_T'
388390
# libevent CMakeLists.txt defaults to 'int' if neither is available, which seems wrong...
@@ -425,9 +427,9 @@ def run(self):
425427
DEFS, dry_run=self.dry_run)
426428

427429
if self.dry_run:
428-
log.info('Would create pvxsVCS.h')
430+
print('Would create pvxsVCS.h')
429431
else:
430-
log.info('Writing pvxsVCS.h')
432+
print('Writing pvxsVCS.h')
431433
with open(os.path.join(self.build_temp, 'pvxsVCS.h'), 'w') as F:
432434
F.write('''
433435
#ifndef PVXS_VCS_VERSION
@@ -452,7 +454,7 @@ def finalize_options(self):
452454
('build_temp', 'build_temp'),
453455
)
454456
def run(self):
455-
log.info("In InstallHeaders")
457+
print("In InstallHeaders")
456458

457459
for header in glob('src/pvxs/*.h'):
458460
self.copy_file(header,
@@ -713,7 +715,6 @@ def define_DSOS(self):
713715
license='BSD',
714716
classifiers = [
715717
'Development Status :: 5 - Production/Stable',
716-
'Programming Language :: Python :: 2.7',
717718
'Programming Language :: Python :: 3',
718719
'Programming Language :: Python :: Implementation :: CPython',
719720
'Intended Audience :: Science/Research',
@@ -725,7 +726,7 @@ def define_DSOS(self):
725726
'Operating System :: Microsoft :: Windows',
726727
],
727728
keywords='epics scada',
728-
python_requires='>=2.7',
729+
python_requires='>=3.8',
729730

730731
# setup/build time dependencies listed in pyproject.toml
731732
# cf. PEP 518

0 commit comments

Comments
 (0)