Skip to content

Commit ba258b1

Browse files
committed
Drop support for Python 3.6
1 parent 5d3ad4e commit ba258b1

File tree

5 files changed

+19
-64
lines changed

5 files changed

+19
-64
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ jobs:
4040
strategy:
4141
matrix:
4242
python-version:
43-
- "3.6"
4443
- "3.7"
4544
- "3.8"
4645
- "3.9"
@@ -51,9 +50,6 @@ jobs:
5150
- os: ubuntu-latest
5251

5352
# older versions need older OS
54-
- python-version: "3.6"
55-
os: ubuntu-20.04
56-
5753
- python-version: "3.7"
5854
os: ubuntu-22.04
5955

@@ -192,7 +188,8 @@ jobs:
192188
matrix:
193189
os:
194190
- windows-latest
195-
- macos-latest
191+
- macos-13 # intel-based macos
192+
- macos-latest # Apple silicon
196193
- ubuntu-latest
197194
include:
198195
# Only build CPython 3.x targets
@@ -204,8 +201,8 @@ jobs:
204201
- name: Build wheels
205202
uses: pypa/cibuildwheel@v2.22.0
206203
env:
207-
# Only build CPython ABI3 targets
208-
CIBW_BUILD: "cp3*-abi3-*"
204+
# Only build CPython targets
205+
CIBW_BUILD: "cp3*"
209206
# Ensure full C++17 availability on macOS builds
210207
MACOSX_DEPLOYMENT_TARGET: "10.13"
211208
# Signal setup.py to fail if binary build fails

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
[project]
66
name = "systemrdl-compiler"
77
dynamic = ["version"]
8-
requires-python = ">=3.6"
8+
requires-python = ">=3.7"
99
dependencies = [
1010
"antlr4-python3-runtime >= 4.11, < 4.14",
1111
"colorama",
@@ -25,7 +25,6 @@ classifiers = [
2525
"Development Status :: 5 - Production/Stable",
2626
"Programming Language :: Python",
2727
"Programming Language :: Python :: 3",
28-
"Programming Language :: Python :: 3.6",
2928
"Programming Language :: Python :: 3.7",
3029
"Programming Language :: Python :: 3.8",
3130
"Programming Language :: Python :: 3.9",

setup.cfg

Lines changed: 0 additions & 8 deletions
This file was deleted.

setup.py

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import sys
21
import os
32
import platform
4-
import fnmatch
53
import setuptools
4+
from glob import glob
65

76
target = platform.system().lower()
87
PLATFORMS = {'windows', 'linux', 'darwin', 'cygwin'}
@@ -27,15 +26,15 @@ def run_setup(with_binary):
2726
include_dirs=["src/systemrdl/parser/ext/antlr4-cpp-runtime"],
2827

2928
# Rather than listing each C++ file (Antlr has a lot!), discover them automatically
30-
sources=get_files("src/systemrdl/parser/ext", "*.cpp"),
31-
depends=get_files("src/systemrdl/parser/ext", "*.h"),
29+
sources=glob("src/systemrdl/parser/ext/**/*.cpp", recursive=True),
30+
depends=glob("src/systemrdl/parser/ext/**/*.h", recursive=True),
3231

3332
extra_compile_args=extra_compile_args.get(target, []),
34-
define_macros=[("Py_LIMITED_API", "0x03060000")],
33+
define_macros=[("Py_LIMITED_API", "0x03070000")],
3534
py_limited_api=True,
3635
)
3736
ext_modules = [parser_ext]
38-
options = {"bdist_wheel": {"py_limited_api": "cp36"}}
37+
options = {"bdist_wheel": {"py_limited_api": "cp37"}}
3938
else:
4039
ext_modules = []
4140
options = {}
@@ -50,27 +49,14 @@ def run_setup(with_binary):
5049
#===============================================================================
5150
from setuptools.command.build_ext import build_ext
5251

53-
def get_files(path, pattern):
54-
"""
55-
Recursive file search that is compatible with python3.4 and older
56-
"""
57-
matches = []
58-
for root, _, filenames in os.walk(path):
59-
for filename in fnmatch.filter(filenames, pattern):
60-
matches.append(os.path.join(root, filename))
61-
return matches
62-
63-
6452
class BuildFailed(Exception):
6553
pass
6654

67-
6855
class ve_build_ext(build_ext):
6956
"""
7057
This class extends setuptools to fail with a common BuildFailed exception
7158
if a build fails
7259
"""
73-
7460
def run(self):
7561
try:
7662
build_ext.run(self)
@@ -83,29 +69,15 @@ def build_extension(self, ext):
8369
except Exception:
8470
raise BuildFailed()
8571

86-
87-
# Detect if an alternate interpreter is being used
88-
is_jython = "java" in sys.platform
89-
is_pypy = hasattr(sys, "pypy_version_info")
90-
91-
# Antlr accelerator is no longer supported on older Python versions
92-
is_old_python = sys.version_info[0:2] <= (3, 5)
93-
94-
# Force using fallback python parser under some conditions
95-
using_fallback = is_jython or is_pypy or is_old_python
96-
97-
if 'SYSTEMRDL_SKIP_BINARY_BUILD' in os.environ:
98-
using_fallback = True
99-
100-
if not using_fallback:
101-
try:
102-
run_setup(with_binary=True)
103-
except BuildFailed:
104-
if 'SYSTEMRDL_REQUIRE_BINARY_BUILD' in os.environ:
105-
# Force failure if binary build is required
106-
raise
107-
else:
108-
using_fallback = True
72+
using_fallback = False
73+
try:
74+
run_setup(with_binary=True)
75+
except BuildFailed:
76+
if 'SYSTEMRDL_REQUIRE_BINARY_BUILD' in os.environ:
77+
# Force failure if binary build is required
78+
raise
79+
else:
80+
using_fallback = True
10981

11082
if using_fallback:
11183
run_setup(with_binary=False)

test/test_parse_accelerator.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import os
2-
import sys
32
import unittest
43

54
from systemrdl.parser import sa_systemrdl
65

76
class TestInstalled(unittest.TestCase):
87
def test_installed(self):
9-
if sys.version_info[0:2] <= (3, 5):
10-
# Don't care for older versions of Python. Accelerator is no longer supported
11-
return
12-
138
if 'SYSTEMRDL_DISABLE_ACCELERATOR' not in os.environ:
149
# Ensure that C++ accelerator installed correctly
1510
self.assertTrue(sa_systemrdl.USE_CPP_IMPLEMENTATION)

0 commit comments

Comments
 (0)